package com.turing.post.webservice.impl;

import java.math.BigInteger;
import java.util.Date;
import java.util.List;

import javax.ejb.EJB;
import javax.jws.WebService;
import javax.naming.InitialContext;

import com.turing.post.account.util.AccountSystemAddTradDetail;
import com.turing.post.account.util.AccountSystemAddTradDetailDao;
import com.turing.post.account.util.BankAssoc;
import com.turing.post.account.util.LoadApduResult;
import com.turing.post.account.util.MasterAccount;
import com.turing.post.account.util.MasterAccountDao;
import com.turing.post.account.util.OnlineLoadDetail;
import com.turing.post.account.util.OnlineLoadDetailBusiness;
import com.turing.post.account.util.OnlineLoadDetailDao;
import com.turing.post.account.util.OnlineTransferDetail;
import com.turing.post.account.util.OnlineTransferDetailBusiness;
import com.turing.post.account.util.OnlineTransferDetailDao;
import com.turing.post.account.util.SubAccount;
import com.turing.post.account.util.SubAccountDao;
import com.turing.post.antimoney.util.AlarmInfo;
import com.turing.post.antimoney.util.AlarmInfoBusiness;
import com.turing.post.antimoney.util.AlarmInfoDao;
import com.turing.post.antimoney.util.AlarmInfoDetail;
import com.turing.post.antimoney.util.AlarmInfoDetailDao;
import com.turing.post.antimoney.util.AlarmRule;
import com.turing.post.antimoney.util.AlarmRuleBusiness;
import com.turing.post.antimoney.util.AlarmRuleDao;
import com.turing.post.antimoney.util.AlarmRulesBusiness;
import com.turing.post.antimoney.util.SuspiciousReport;
import com.turing.post.antimoney.util.SuspiciousReportBusiness;
import com.turing.post.antimoney.util.SuspiciousReportDao;
import com.turing.post.antimoney.util.SuspiciousTrans;
import com.turing.post.antimoney.util.SuspiciousTransBusiness;
import com.turing.post.antimoney.util.SuspiciousTransDao;
import com.turing.post.capitalaccounts.util.BankAccount;
import com.turing.post.capitalaccounts.util.BankAccountDao;
import com.turing.post.capitalaccounts.util.BankAccountDetail;
import com.turing.post.capitalaccounts.util.BankAccountDetailBusiness;
import com.turing.post.capitalaccounts.util.BankAccountDetailDao;
import com.turing.post.capitalaccounts.util.CapitalApplicationException;
import com.turing.post.capitalaccounts.util.FundsReportDao;
import com.turing.post.capitalaccounts.util.FundsReportObj;
import com.turing.post.capitalaccounts.util.SaleCapitalDetail;
import com.turing.post.capitalaccounts.util.SaleCapitalDetailDao;
import com.turing.post.capitalaccounts.util.SaleCashWithdrawBill;
import com.turing.post.capitalaccounts.util.SaleCashWithdrawBillBusiness;
import com.turing.post.capitalaccounts.util.SaleCashWithdrawBillDao;
import com.turing.post.capitalaccounts.util.SaleCreditDepositBill;
import com.turing.post.capitalaccounts.util.SaleCreditDepositBillBusiness;
import com.turing.post.capitalaccounts.util.SaleCreditDepositBillDao;
import com.turing.post.cardmanagement.util.ActivateCard;
import com.turing.post.cardmanagement.util.ActivateCardBusiness;
import com.turing.post.cardmanagement.util.ActivateCardDao;
import com.turing.post.cardmanagement.util.AdjustInOutStockOrder;
import com.turing.post.cardmanagement.util.AdjustInOutStockOrderBusiness;
import com.turing.post.cardmanagement.util.AdjustInOutStockOrderDao;
import com.turing.post.cardmanagement.util.AdjustInOutStockOrderDetail;
import com.turing.post.cardmanagement.util.AdjustInOutStockOrderDetailDao;
import com.turing.post.cardmanagement.util.ApduExecuteObj;
import com.turing.post.cardmanagement.util.AppCardFaceAssoc;
import com.turing.post.cardmanagement.util.AppCardFaceAssocBusiness;
import com.turing.post.cardmanagement.util.AppCardFaceAssocDao;
import com.turing.post.cardmanagement.util.AppManagement;
import com.turing.post.cardmanagement.util.AppManagementBusiness;
import com.turing.post.cardmanagement.util.AppManagementDao;
import com.turing.post.cardmanagement.util.AppZoneInf;
import com.turing.post.cardmanagement.util.AppZoneInfResult;
import com.turing.post.cardmanagement.util.BranchCardStock;
import com.turing.post.cardmanagement.util.CardATS;
import com.turing.post.cardmanagement.util.CardATSBusiness;
import com.turing.post.cardmanagement.util.CardATSDao;
import com.turing.post.cardmanagement.util.CardClassic;
import com.turing.post.cardmanagement.util.CardClassicBindDistrict;
import com.turing.post.cardmanagement.util.CardClassicBindDistrictDao;
import com.turing.post.cardmanagement.util.CardClassicBindMerchant;
import com.turing.post.cardmanagement.util.CardClassicBindMerchantDao;
import com.turing.post.cardmanagement.util.CardClassicBusiness;
import com.turing.post.cardmanagement.util.CardClassicDao;
import com.turing.post.cardmanagement.util.CardEventLog;
import com.turing.post.cardmanagement.util.CardEventLogDao;
import com.turing.post.cardmanagement.util.CardEventLogReport;
import com.turing.post.cardmanagement.util.CardFace;
import com.turing.post.cardmanagement.util.CardFaceBusiness;
import com.turing.post.cardmanagement.util.CardFaceDao;
import com.turing.post.cardmanagement.util.CardLoss;
import com.turing.post.cardmanagement.util.CardLossDao;
import com.turing.post.cardmanagement.util.CardManufacture;
import com.turing.post.cardmanagement.util.CardManufactureBusiness;
import com.turing.post.cardmanagement.util.CardManufactureDao;
import com.turing.post.cardmanagement.util.CardParValue;
import com.turing.post.cardmanagement.util.CardParValueDao;
import com.turing.post.cardmanagement.util.CardStock;
import com.turing.post.cardmanagement.util.CardStockBusiness;
import com.turing.post.cardmanagement.util.CardStockClassicInfo;
import com.turing.post.cardmanagement.util.CardStockDao;
import com.turing.post.cardmanagement.util.InitialInStockOrder;
import com.turing.post.cardmanagement.util.InitialInStockOrderDao;
import com.turing.post.cardmanagement.util.IssueCardStockDetail;
import com.turing.post.cardmanagement.util.IssueCardStockDetailDao;
import com.turing.post.cardmanagement.util.MakeCardActionDetail;
import com.turing.post.cardmanagement.util.MakeCardActionDetailDao;
import com.turing.post.cardmanagement.util.MakeCardApproval;
import com.turing.post.cardmanagement.util.MakeCardApprovalBusiness;
import com.turing.post.cardmanagement.util.MakeCardApprovalDao;
import com.turing.post.cardmanagement.util.MakeCardControl;
import com.turing.post.cardmanagement.util.MakeCardControlBusiness;
import com.turing.post.cardmanagement.util.MakeCardControlDao;
import com.turing.post.cardmanagement.util.ProxyIssue;
import com.turing.post.cardmanagement.util.ProxyIssueDao;
import com.turing.post.cardmanagement.util.SaleCardStockDetail;
import com.turing.post.cardmanagement.util.SaleCardStockDetailDao;
import com.turing.post.cardmanagement.util.SalesGetCardOrder;
import com.turing.post.cardmanagement.util.SalesGetCardOrderBusiness;
import com.turing.post.cardmanagement.util.SalesGetCardOrderDao;
import com.turing.post.cardmanagement.util.SalesGetCardOrderDetail;
import com.turing.post.cardmanagement.util.SalesGetCardOrderDetailDao;
import com.turing.post.cardmanagement.util.TransferInOutStockApproval;
import com.turing.post.cardmanagement.util.TransferInOutStockApprovalBusiness;
import com.turing.post.cardmanagement.util.TransferInOutStockApprovalDao;
import com.turing.post.cardmanagement.util.TransferInOutStockOrder;
import com.turing.post.cardmanagement.util.TransferInOutStockOrderBusiness;
import com.turing.post.cardmanagement.util.TransferInOutStockOrderDao;
import com.turing.post.cardmanagement.util.TransferInOutStockOrderDetail;
import com.turing.post.cardmanagement.util.TransferInOutStockOrderDetailDao;
import com.turing.post.cardmanagement.util.TransferOrderActionDetail;
import com.turing.post.cardmanagement.util.TransferOrderActionDetailDao;
import com.turing.post.cardtransactions.util.CardLossObject;
import com.turing.post.cardtransactions.util.CardLossResult;
import com.turing.post.cardtransactions.util.CardMagneticObject;
import com.turing.post.cardtransactions.util.CardMagneticResult;
import com.turing.post.cardtransactions.util.CardOwnerObject;
import com.turing.post.cardtransactions.util.CardOwnerResult;
import com.turing.post.cardtransactions.util.CardTransBusiness;
import com.turing.post.cardtransactions.util.CashDepositObject;
import com.turing.post.cardtransactions.util.CashDepositResult;
import com.turing.post.cardtransactions.util.ChangeCardClassicObject;
import com.turing.post.cardtransactions.util.ChangeCardClassicResult;
import com.turing.post.cardtransactions.util.ExtendExpiredObject;
import com.turing.post.cardtransactions.util.ExtendExpiredResult;
import com.turing.post.cardtransactions.util.FreezeAccountObject;
import com.turing.post.cardtransactions.util.FreezeAccountResult;
import com.turing.post.cardtransactions.util.IssueNewCardObject;
import com.turing.post.cardtransactions.util.IssueNewCardResult;
import com.turing.post.cardtransactions.util.RedempObject;
import com.turing.post.cardtransactions.util.RedempResult;
import com.turing.post.cardtransactions.util.ResetPasswordObject;
import com.turing.post.cardtransactions.util.ResetPasswordResult;
import com.turing.post.cardtransactions.util.SaleTransBusiness;
import com.turing.post.common.util.BlackList;
import com.turing.post.common.util.BlackListBusiness;
import com.turing.post.common.util.BlackListDao;
import com.turing.post.common.util.ContrastDao;
import com.turing.post.common.util.Global;
import com.turing.post.common.util.GlobalDao;
import com.turing.post.common.util.IdType;
import com.turing.post.common.util.IdTypeDao;
import com.turing.post.common.util.LeftMenu;
import com.turing.post.common.util.LogonResult;
import com.turing.post.common.util.MerchantOper;
import com.turing.post.common.util.MerchantOperBusiness;
import com.turing.post.common.util.NationCode;
import com.turing.post.common.util.NationCodeDao;
import com.turing.post.common.util.PCPSCommonDao;
import com.turing.post.common.util.Region;
import com.turing.post.common.util.RegionDao;
import com.turing.post.common.util.SysOpMenu;
import com.turing.post.common.util.SysOpMenuDao;
import com.turing.post.common.util.SysOpMenuGroup;
import com.turing.post.common.util.SysOpMenuGroupDao;
import com.turing.post.common.util.SysOpRole;
import com.turing.post.common.util.SysOpRoleDao;
import com.turing.post.common.util.SysOpSap;
import com.turing.post.common.util.SysOpSapDao;
import com.turing.post.common.util.SysOpUser;
import com.turing.post.common.util.SysOpUserBusiness;
import com.turing.post.common.util.SysOpUserDao;
import com.turing.post.common.util.SysOpUserRole;
import com.turing.post.common.util.SysOpUserRoleDao;
import com.turing.post.common.util.SysOperLog;
import com.turing.post.common.util.SysOperLogDao;
import com.turing.post.datasorting.util.InComeSortingBusiness;
import com.turing.post.organization.util.BankManage;
import com.turing.post.organization.util.BankManageBusiness;
import com.turing.post.organization.util.BankManageDao;
import com.turing.post.organization.util.BusinessDistrict;
import com.turing.post.organization.util.BusinessDistrictBusiness;
import com.turing.post.organization.util.BusinessDistrictDao;
import com.turing.post.organization.util.BusinessDistrictMerchant;
import com.turing.post.organization.util.BusinessDistrictMerchantDao;
import com.turing.post.organization.util.ConsumeTerminal;
import com.turing.post.organization.util.ConsumeTerminalBusiness;
import com.turing.post.organization.util.ConsumeTerminalDao;
import com.turing.post.organization.util.CreditAccDetail;
import com.turing.post.organization.util.CreditAccDetailDao;
import com.turing.post.organization.util.IncomeBranch;
import com.turing.post.organization.util.IncomeBranchBusiness;
import com.turing.post.organization.util.IncomeBranchDao;
import com.turing.post.organization.util.IssueBranch;
import com.turing.post.organization.util.IssueBranchBusiness;
import com.turing.post.organization.util.IssueBranchDao;
import com.turing.post.organization.util.IssueCompany;
import com.turing.post.organization.util.IssueCompanyBusiness;
import com.turing.post.organization.util.IssueCompanyDao;
import com.turing.post.organization.util.IssueFeePolicy;
import com.turing.post.organization.util.IssueFeePolicyBusiness;
import com.turing.post.organization.util.IssueFeePolicyDao;
import com.turing.post.organization.util.IssueFeePolicyLimit;
import com.turing.post.organization.util.IssueFeePolicyLimitBusiness;
import com.turing.post.organization.util.Merchant;
import com.turing.post.organization.util.MerchantBranch;
import com.turing.post.organization.util.MerchantBranchBusiness;
import com.turing.post.organization.util.MerchantBranchDao;
import com.turing.post.organization.util.MerchantBusiness;
import com.turing.post.organization.util.MerchantBusinessType;
import com.turing.post.organization.util.MerchantBusinessTypeBusiness;
import com.turing.post.organization.util.MerchantBusinessTypeDao;
import com.turing.post.organization.util.MerchantContract;
import com.turing.post.organization.util.MerchantContractBusiness;
import com.turing.post.organization.util.MerchantContractDao;
import com.turing.post.organization.util.MerchantDao;
import com.turing.post.organization.util.MerchantFeePolicy;
import com.turing.post.organization.util.MerchantFeePolicyBusiness;
import com.turing.post.organization.util.MerchantFeePolicyDao;
import com.turing.post.organization.util.MerchantFeeSettlementPolicy;
import com.turing.post.organization.util.MerchantFeeSettlementPolicyBusiness;
import com.turing.post.organization.util.MerchantFeeSettlementPolicyDao;
import com.turing.post.organization.util.MerchantPaidFee;
import com.turing.post.organization.util.MerchantPaidFeeBusiness;
import com.turing.post.organization.util.MerchantPaidFeeDao;
import com.turing.post.organization.util.MerchantSecretPolicy;
import com.turing.post.organization.util.MerchantSecretPolicyBusiness;
import com.turing.post.organization.util.MerchantSecretPolicyDao;
import com.turing.post.organization.util.MerchantSettDetail;
import com.turing.post.organization.util.MerchantSettDetailBusiness;
import com.turing.post.organization.util.MerchantType;
import com.turing.post.organization.util.MerchantTypeDao;
import com.turing.post.organization.util.OrganTreeList;
import com.turing.post.organization.util.SaleBranch;
import com.turing.post.organization.util.SaleBranchBusiness;
import com.turing.post.organization.util.SaleBranchDao;
import com.turing.post.organization.util.SysBranch;
import com.turing.post.organization.util.SysBranchDao;
import com.turing.post.organization.util.SysBranchSubord;
import com.turing.post.organization.util.SysBranchSubordDao;
import com.turing.post.organization.util.Voucher;
import com.turing.post.organization.util.VoucherAdjustOrder;
import com.turing.post.organization.util.VoucherAdjustOrderBusiness;
import com.turing.post.organization.util.VoucherAdjustOrderDao;
import com.turing.post.organization.util.VoucherAdjustOrderDetail;
import com.turing.post.organization.util.VoucherAdjustOrderDetailDao;
import com.turing.post.organization.util.VoucherBusiness;
import com.turing.post.organization.util.VoucherBusinessBind;
import com.turing.post.organization.util.VoucherBusinessBindBusiness;
import com.turing.post.organization.util.VoucherBusinessBindDao;
import com.turing.post.organization.util.VoucherDao;
import com.turing.post.organization.util.VoucherInStockOrder;
import com.turing.post.organization.util.VoucherInStockOrderBusiness;
import com.turing.post.organization.util.VoucherInStockOrderDao;
import com.turing.post.organization.util.VoucherInStockOrderDetail;
import com.turing.post.organization.util.VoucherInStockOrderDetailDao;
import com.turing.post.organization.util.VoucherOrderActionDetail;
import com.turing.post.organization.util.VoucherOrderActionDetailDao;
import com.turing.post.organization.util.VoucherStock;
import com.turing.post.organization.util.VoucherStockBusiness;
import com.turing.post.organization.util.VoucherStockDao;
import com.turing.post.organization.util.VoucherStockDetail;
import com.turing.post.organization.util.VoucherStockDetailDao;
import com.turing.post.organization.util.VoucherTransferOrder;
import com.turing.post.organization.util.VoucherTransferOrderBusiness;
import com.turing.post.organization.util.VoucherTransferOrderDao;
import com.turing.post.organization.util.VoucherTransferOrderDetail;
import com.turing.post.organization.util.VoucherTransferOrderDetailDao;
import com.turing.post.report.util.AccSysBranchDaySettDao;
import com.turing.post.report.util.AccSysDaySett;
import com.turing.post.report.util.AccSysDaySettDao;
import com.turing.post.report.util.BinaryFileInfo;
import com.turing.post.report.util.BinaryFileInfoDao;
import com.turing.post.report.util.BranchDaySettDao;
import com.turing.post.report.util.CreditDaySettlementDao;
import com.turing.post.report.util.DaySettlementBusiness;
import com.turing.post.report.util.IncomeDaySettlementDao;
import com.turing.post.report.util.MchTradErrLog;
import com.turing.post.report.util.MchTradErrLogDao;
import com.turing.post.report.util.MerchantBusinessDaySettlementDao;
import com.turing.post.report.util.MerchantDaySettlement;
import com.turing.post.report.util.MerchantDaySettlementDao;
import com.turing.post.report.util.SaleCapitalDaySettlementDao;
import com.turing.post.report.util.SaleCardStockDaySettlementDao;
import com.turing.post.salesmanage.util.DepositOrder;
import com.turing.post.salesmanage.util.DepositOrderActionDetail;
import com.turing.post.salesmanage.util.DepositOrderActionDetailDao;
import com.turing.post.salesmanage.util.DepositOrderBusiness;
import com.turing.post.salesmanage.util.DepositOrderDao;
import com.turing.post.salesmanage.util.DepositOrderDetail;
import com.turing.post.salesmanage.util.DepositOrderDetailBusiness;
import com.turing.post.salesmanage.util.DepositOrderDetailDao;
import com.turing.post.salesmanage.util.DepositOrderPaidDetail;
import com.turing.post.salesmanage.util.DepositOrderPaidDetailBusiness;
import com.turing.post.salesmanage.util.DepositOrderPaidDetailDao;
import com.turing.post.salesmanage.util.DepositOrderSalesDetail;
import com.turing.post.salesmanage.util.DepositOrderSalesDetailBusiness;
import com.turing.post.salesmanage.util.DepositOrderSalesDetailDao;
import com.turing.post.salesmanage.util.GasAutoManagement;
import com.turing.post.salesmanage.util.GasAutoManagementBusiness;
import com.turing.post.salesmanage.util.Industry;
import com.turing.post.salesmanage.util.IndustryDao;
import com.turing.post.salesmanage.util.OrganizeCustom;
import com.turing.post.salesmanage.util.OrganizeCustomBusiness;
import com.turing.post.salesmanage.util.OrganizeCustomDao;
import com.turing.post.salesmanage.util.OrganizeInfDetail;
import com.turing.post.salesmanage.util.OrganizeInfDetailBusiness;
import com.turing.post.salesmanage.util.OrganizeInfDetailDao;
import com.turing.post.salesmanage.util.PersonalCustom;
import com.turing.post.salesmanage.util.PersonalCustomBusiness;
import com.turing.post.salesmanage.util.PersonalCustomDao;
import com.turing.post.salesmanage.util.Profession;
import com.turing.post.salesmanage.util.ProfessionDao;
import com.turing.post.salesmanage.util.RedempOrder;
import com.turing.post.salesmanage.util.RedempOrderActionDetail;
import com.turing.post.salesmanage.util.RedempOrderActionDetailDao;
import com.turing.post.salesmanage.util.RedempOrderBusiness;
import com.turing.post.salesmanage.util.RedempOrderDao;
import com.turing.post.salesmanage.util.RedempOrderDetail;
import com.turing.post.salesmanage.util.RedempOrderDetailBusiness;
import com.turing.post.salesmanage.util.RedempOrderDetailDao;
import com.turing.post.salesmanage.util.SaleOrder;
import com.turing.post.salesmanage.util.SaleOrderActionDetail;
import com.turing.post.salesmanage.util.SaleOrderActionDetailDao;
import com.turing.post.salesmanage.util.SaleOrderBusiness;
import com.turing.post.salesmanage.util.SaleOrderCardDetail;
import com.turing.post.salesmanage.util.SaleOrderCardDetailDao;
import com.turing.post.salesmanage.util.SaleOrderDao;
import com.turing.post.salesmanage.util.SaleOrderPaidDetail;
import com.turing.post.salesmanage.util.SaleOrderPaidDetailDao;
import com.turing.post.salesmanage.util.SaleOrderRealNameDetail;
import com.turing.post.salesmanage.util.SaleOrderRealNameDetailDao;
import com.turing.post.salesmanage.util.SaleOrderResult;
import com.turing.post.salesmanage.util.SaleOrderSalesDetail;
import com.turing.post.salesmanage.util.SaleOrderSalesDetailDao;
import com.turing.post.salesmanage.util.Sales;
import com.turing.post.salesmanage.util.SalesBusiness;
import com.turing.post.salesmanage.util.SalesDao;
import com.turing.post.transaction.util.MchAccDetail;
import com.turing.post.transaction.util.MchAccDetailDao;
import com.turing.post.transaction.util.MchAddCardDetail;
import com.turing.post.transaction.util.MchAddCardDetailDao;
import com.turing.post.transaction.util.MchAddTradDetail;
import com.turing.post.transaction.util.MchAddTradDetailDao;
import com.turing.post.transaction.util.MchAddTradSummary;
import com.turing.post.transaction.util.MchAddTradSummaryDao;
import com.turing.post.transaction.util.MchBsTypeTradDetail;
import com.turing.post.transaction.util.MchBsTypeTradDetailDao;
import com.turing.post.transaction.util.MchChkAccCtl;
import com.turing.post.transaction.util.MchChkAccCtlBusiness;
import com.turing.post.transaction.util.MchChkAccCtlDao;
import com.turing.post.transaction.util.MchChkAccCtlSummary;
import com.turing.post.transaction.util.MchChkAccCtlSummaryResult;
import com.turing.post.transaction.util.MchHisTradDetailDao;
import com.turing.post.transaction.util.MchMistakeObject;
import com.turing.post.transaction.util.MchMistakeResult;
import com.turing.post.transaction.util.MchTradDetail;
import com.turing.post.transaction.util.MchTradDetailDao;
import com.turing.post.transaction.util.MrchBusiness;
import com.turing.post.util.CommonWebResult;
import com.turing.post.util.DropdownList;
import com.turing.post.util.PCPSApplicationException;
import com.turing.post.util.PCPSUtil;
import com.turing.post.util.PCPSWebInput;

/**
 * 后台管理服务
 * 
 * @author zxppanda
 * 
 */
@WebService(name = "PostWscImplPortType", serviceName = "PostWscImpl")
public class PostWscImpl {

	// 公用PCPSException异常返回
	private CommonWebResult PCPSException(PCPSApplicationException p) {
		// PCPSApplicationException里日志已记录
		return new CommonWebResult(PCPSUtil.FAILED, p.getErrCodeCategory(), p
				.getErrMsg());
	}

	// 公用Exception异常返回
	private CommonWebResult CommonException(Exception e) {
		PCPSUtil.Log(CommonWebResult.THROW_EXCEPTION_MSG, e);
		return new CommonWebResult(PCPSUtil.FAILED,
				CommonWebResult.THROW_EXCEPTION,
				CommonWebResult.THROW_EXCEPTION_MSG);
	}

	// 图片
	@EJB(mappedName = "report.impl.BinaryFileInfoDaoImpl")
	private BinaryFileInfoDao binaryFileInfoDaoImpl;

	/**
	 * 根据主键查询
	 * 
	 * @return
	 */
	public BinaryFileInfo getBinaryFileInfoById(BigInteger id) {
		return binaryFileInfoDaoImpl.getBinaryFileInfoById(id);
	}

	/**
	 * 删除文件
	 * 
	 */
	public CommonWebResult deleteBinaryFileInfoById(BigInteger id) {
		try {
			binaryFileInfoDaoImpl.deleteBinaryFileInfoById(id);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 新增或创建图片信息
	 * 
	 * @param image
	 * @param oldImageId原图片编号
	 * @return
	 * @throws PCPSAppllicationException
	 */
	public CommonWebResult insertOrUpdateBinaryFile(byte[] image,
			BigInteger oldImageId, String fileType) {
		BigInteger res = BigInteger.ZERO;
		try {
			res = binaryFileInfoDaoImpl.insertOrUpdateBinaryFile(image,
					oldImageId, fileType);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		CommonWebResult cwr = new CommonWebResult();
		cwr.setResult(res.toString());
		return cwr;
	}

	/**
	 * 修改信息
	 * 
	 * @param image
	 * @param oldImageId原图片编号
	 * @return
	 * @throws PCPSAppllicationException
	 */
	public CommonWebResult updateBinaryFileInfo(BinaryFileInfo binaryFileInfo) {

		try {
			binaryFileInfoDaoImpl.updateBinaryFileInfo(binaryFileInfo);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 日志文件记录
	@EJB(mappedName = "common.impl.PCPSCommonDaoImpl")
	private PCPSCommonDao commonDaoImpl;

	// 日志
	@EJB(mappedName = "common.impl.SysOperLogDaoImpl")
	private SysOperLogDao sysOperLogDaoImpl;

	/**
	 * 根据主键编号查询日志
	 * 
	 * @param logId
	 * @return
	 */
	public SysOperLog getSysOperLogById(BigInteger logId) {
		return sysOperLogDaoImpl.getSysOperLogById(logId);
	}

	/**
	 * 查询用户操作日志列表
	 * 
	 * @param webInput
	 * @param OperType
	 *            日志类型
	 * @param startTime
	 *            起始时间
	 * @param endTime
	 *            终止时间
	 * @param page
	 * @return
	 */
	public List<SysOperLog> getSysOperLogListByCondition(PCPSWebInput webInput,
			String OperType, String startTime, String endTime, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return sysOperLogDaoImpl.getSysOperLogListByCondition(webInput,
				OperType, startTime, endTime, page);
	}

	/**
	 * 查询用户操作日志记录数
	 * 
	 * @param webInput
	 * @param OperType
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	public BigInteger getSysOperLogTotalByCondition(PCPSWebInput webInput,
			String OperType, String startTime, String endTime) {
		return sysOperLogDaoImpl.getSysOperLogTotalByCondition(webInput,
				OperType, startTime, endTime);
	}

	/**
	 * 根据id删除日志
	 * 
	 * @param webInput
	 * @param OperType
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	public CommonWebResult deleteSysOperLogByLogId(PCPSWebInput webInput,
			BigInteger logId) throws PCPSApplicationException {
		try {
			sysOperLogDaoImpl.deleteSysOperLogByLogId(webInput, logId);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 菜单common模块===========================start
	 */
	// 菜单组
	@EJB(mappedName = "common.impl.SysOpMenuGroupDaoImpl")
	private SysOpMenuGroupDao sysOpMenuGroupDaoImpl;

	/**
	 * @菜单组表列表,新增菜单目录时选择
	 * @return
	 */
	public List<SysOpMenuGroup> getSysOpMenuGroupList() {
		return sysOpMenuGroupDaoImpl.getSysOpMenuGroupList();
	}

	// 菜单
	@EJB(mappedName = "common.impl.SysOpMenuDaoImpl")
	private SysOpMenuDao sysOpMenuDaoImpl;

	/**
	 * @新增菜单时下拉选择上级菜单目录
	 * @return
	 */
	public List<SysOpMenu> getSysOpMenuByMenuType(Integer menuType) {
		return sysOpMenuDaoImpl.getSysOpMenuByMenuType(menuType);
	}

	/**
	 * @新增菜单 MenuSeqNo默认为0
	 * @param sysOpMenu
	 * @return
	 */
	public CommonWebResult insertSysOpMenu(SysOpMenu sysOpMenu) {
		try {
			sysOpMenuDaoImpl.insertSysOpMenu(sysOpMenu);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 修改前查询
	public SysOpMenu getSysOpMenuByMenuId(Integer menuId) {
		return sysOpMenuDaoImpl.getSysOpMenuByMenuId(menuId);
	}

	// 修改
	public CommonWebResult updateSysOpMenu(SysOpMenu sysOpMenu) {
		try {
			sysOpMenuDaoImpl.updateSysOpMenu(sysOpMenu);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 删除
	public CommonWebResult deleteSysOpMenu(Integer menuId) {
		try {
			sysOpMenuDaoImpl.deleteSysOpMenu(menuId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	public List<SysOpMenu> getSysOpMenuListBySuperMenuId(Integer superMenuId) {
		return sysOpMenuDaoImpl.getSysOpMenuListBySuperMenuId(superMenuId);
	}

	/**
	 * @分页查询菜单列表
	 * @param page
	 *            页码
	 * @return
	 */
	public List<SysOpMenu> getSysOpMenuList(String menuName, String menuType,
			Integer page) {
		return sysOpMenuDaoImpl.getSysOpMenuList(menuName, menuType, page);
	}

	/**
	 * @查询菜单表记录条数
	 * @return
	 */
	public BigInteger getSysOpMenuTotal(String menuName, String menuType) {
		return sysOpMenuDaoImpl.getSysOpMenuTotal(menuName, menuType);
	}

	// 角色
	@EJB(mappedName = "common.impl.SysOpRoleDaoImpl")
	private SysOpRoleDao sysOpRoleDaoImpl;

	/**
	 * @查询菜单表记录条数
	 * @return
	 */
	public BigInteger getSysOpRoleTotal(PCPSWebInput input, String brchType) {
		return sysOpRoleDaoImpl.getSysOpRoleTotal(input, brchType);
	}

	/**
	 * @分页查询角色列表
	 * @param page
	 * @return
	 */
	public List<SysOpRole> getSysOpRoleList(PCPSWebInput input,
			String brchType, Integer page) {
		return sysOpRoleDaoImpl.getSysOpRoleList(input, brchType, page);
	}

	@EJB(mappedName = "	common.impl.SysOpUserRoleDaoImpl")
	private SysOpUserRoleDao sysOpUserRoleDaoImpl;

	public List<SysOpUserRole> getSysOpUserRoleByOperId(BigInteger operId) {
		return sysOpUserRoleDaoImpl.getSysOpUserRoleByOperId(operId);
	}

	/**
	 * @新增用户时下拉选择角色列表
	 * @param page
	 * @return
	 */
	public List<SysOpRole> getDropDownSysOpRoleList(PCPSWebInput input,
			String roleBranchType) {
		return sysOpRoleDaoImpl.getSysOpRoleList(input, roleBranchType);
	}

	/**
	 * @查询单条记录
	 * @param roleId
	 * @return
	 */
	public SysOpRole getSysOpRoleByRoleId(Integer roleId) {
		return sysOpRoleDaoImpl.getSysOpRoleByRoleId(roleId);
	}

	/**
	 * @插入新记录
	 * @param sysOpRole
	 */
	public CommonWebResult insertSysOpRole(PCPSWebInput input,
			SysOpRole sysOpRole) {
		try {
			sysOpRoleDaoImpl.insertSysOpRole(input, sysOpRole);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @修改新记录
	 * @param sysOpRole
	 */
	public CommonWebResult updateSysOpRole(SysOpRole sysOpRole) {
		try {
			sysOpRoleDaoImpl.updateSysOpRole(sysOpRole);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @根据主键删除记录
	 * @param RoleId
	 */
	public CommonWebResult deleteSysOpRole(Integer roleId) {
		try {
			sysOpRoleDaoImpl.deleteSysOpRole(roleId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 服务
	@EJB(mappedName = "common.impl.SysOpSapDaoImpl")
	private SysOpSapDao sysOpSapDaoImpl;

	/**
	 * @分页查询服务列表
	 * @param page
	 * @return
	 */
	public List<SysOpSap> getSysOpSapList(String sapName, Integer page) {
		return sysOpSapDaoImpl.getSysOpSapList(sapName, page);
	}

	/**
	 * 根据服务编号查询页面上层文字内容
	 * 
	 * @param sapId
	 * @return
	 */
	public LeftMenu getTitleNameByMenuId(Integer menuId) {
		return sysOpSapDaoImpl.getTitleNameByMenuId(menuId);
	}

	/**
	 * @查询服务表记录条数
	 * @return
	 */
	public BigInteger getSysOpSapTotal(String sapName) {
		return sysOpSapDaoImpl.getSysOpSapTotal(sapName);
	}

	/**
	 * @查询单条记录
	 * @param roleId
	 * @return
	 */
	public SysOpSap getSysOpSapBySapId(Integer sapId) {
		return sysOpSapDaoImpl.getSysOpSapBySapId(sapId);
	}

	/**
	 * @插入新记录
	 * @param SysOpSap
	 */
	public CommonWebResult insertSysOpSap(SysOpSap sysOpSap) {
		try {
			sysOpSapDaoImpl.insertSysOpSap(sysOpSap);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @修改新记录
	 * @param SysOpSap
	 */
	public CommonWebResult updateSysOpSap(SysOpSap sysOpSap) {
		try {
			sysOpSapDaoImpl.updateSysOpSap(sysOpSap);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @根据主键删除记录
	 * @param RoleId
	 */
	public CommonWebResult deleteSysOpSap(Integer sapId) {
		try {
			sysOpSapDaoImpl.deleteSysOpSap(sapId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 用户
	@EJB(mappedName = "common.impl.SysOpUserDaoImpl")
	private SysOpUserDao sysOpUserDaoImpl;

	@EJB(mappedName = "common.impl.SysOpUserBusinessImpl")
	private SysOpUserBusiness sysOpUserBusinessImpl;

	/**
	 * @用户登录 登录时不添加webinput 日志
	 * @param sysOpUser
	 * @return
	 */
	public LogonResult sysOpUserLogon(PCPSWebInput webInput, SysOpUser sysOpUser) {
		List<SysOpMenuGroup> returnList = null;
		SysOpUser _sysOpUser = null;
		try {
			_sysOpUser = sysOpUserBusinessImpl.sysOpUserLogon(webInput,
					sysOpUser);
			// 密码错误
			if (!_sysOpUser.getErrorMsg().equals("")) {
				return sysOpUserBusinessImpl.insertSysOperLog(webInput,
						_sysOpUser);
			} else {
				sysOpUserBusinessImpl.insertSysOperLog(webInput, _sysOpUser);
				returnList = sysOpUserBusinessImpl
						.getLogonSysOpMenuGroup(_sysOpUser);
			}
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new LogonResult(PCPSUtil.FAILED, p.getErrCodeCategory(), p
					.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new LogonResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new LogonResult(returnList, _sysOpUser);
	}

	/**
	 * 根据用户Id得到用户的服务列表
	 * 
	 * @param operId
	 * @return
	 */
	public List<SysOpSap> getSysOpSapListByOperId(BigInteger operId) {
		return sysOpSapDaoImpl.getSysOpSapListByOperId(operId);
	}

	/**
	 * 用户登录后待办事项
	 * 
	 * @param webInput
	 * @return
	 * @throws PCPSApplicationException
	 */
	public List<SysOpSap> getAgencyList(PCPSWebInput webInput) {

		commonDaoImpl.setSysLogPath(webInput);
		return sysOpUserBusinessImpl.getAgencyList(webInput);
	}

	/**
	 * 修改安全问题
	 * 
	 * @param webInput
	 * @param sysOpUser
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult updateSysOpUserQuestion(PCPSWebInput webInput,
			SysOpUser sysOpUser) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			sysOpUserBusinessImpl.updateSysOpUserQuestion(webInput, sysOpUser);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @根据用户主键编号查询用户信息
	 * @param operId
	 * @return
	 */
	public SysOpUser getSysOpUserByOperId(BigInteger operId) {
		return sysOpUserDaoImpl.getSysOpUserByOperId(operId);
	}

	public CommonWebResult deleteSysOpUser(BigInteger operId) {
		try {
			sysOpUserBusinessImpl.deleteSysOpUser(operId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @根据用户登录名查询用户信息
	 * @param operId
	 * @return
	 */
	public SysOpUser getSysOpUserByOperLogonName(String operLogonName) {
		return sysOpUserDaoImpl.getSysOpUserByOperLogonName(operLogonName);
	}

	/**
	 * 登录界面找回密码时根据用户登录名查询安全问题
	 * 
	 * @param operLogonName
	 *            用户登录名
	 * @return 用户不存在返回null
	 */
	public SysOpUser getQuestionByByOperLogonName(String operLogonName) {
		return sysOpUserDaoImpl.getQuestionByByOperLogonName(operLogonName);
	}

	/**
	 * 查询平台管理员以及发卡商管理员
	 * 
	 * @param isSysBranch
	 *            true 平台管理员 查询所有发卡商管理员 false 发卡商管理员
	 * @param page
	 * @return
	 */
	public List<SysOpUser> getSysAndIssueSysOpUserList(PCPSWebInput webInput,
			boolean isSysBranch, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return sysOpUserDaoImpl.getSysAndIssueSysOpUserList(isSysBranch, page);
	}

	/**
	 * 查询平台管理员以及发卡商管理员记录数
	 * 
	 * @param isSysBranch
	 *            true 平台管理员 查询所有发卡商管理员 false 发卡商管理员
	 * @return
	 */
	public BigInteger getSysAndIssueSysOpUserTotal(boolean isSysBranch) {
		return sysOpUserDaoImpl.getSysAndIssueSysOpUserTotal(isSysBranch);
	}

	/**
	 * 第一次点菜单进入如果branchNo为空时webInput必须附上登录用户归属机构号
	 * 
	 * @分页查询发卡商操作员以下所有操作员
	 * @param page
	 * @return
	 */
	public List<SysOpUser> getSysOpUserList(PCPSWebInput webInput,
			String branchNo, String status, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return sysOpUserDaoImpl.getSysOpUserList(webInput, branchNo, status,
				page);
	}

	/**
	 * @查询用户表记录条数
	 * @return
	 */
	public BigInteger getSysOpUserTotal(PCPSWebInput webInput, String branchNo,
			String status) {
		return sysOpUserDaoImpl.getSysOpUserTotal(webInput, branchNo, status);
	}

	/**
	 * @新增用户
	 * @param SysOpUser
	 * @return
	 */
	public CommonWebResult insertSysOpUser(PCPSWebInput webInput,
			SysOpUser sysOpUser) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			sysOpUserBusinessImpl.insertSysOpUser(webInput, sysOpUser);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @修改用户
	 * @param SysOpUser
	 */
	public CommonWebResult updateSysOpUser(PCPSWebInput webInput,
			SysOpUser sysOpUser, BigInteger roleId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			sysOpUserBusinessImpl.updateSysOpUser(webInput, sysOpUser, roleId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 修改密码
	public CommonWebResult updateSysOpUserPassword(PCPSWebInput webInput,
			String oldPassword, SysOpUser sysOpUser) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			sysOpUserBusinessImpl.updateSysOpUserPassword(webInput,
					oldPassword, sysOpUser);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 登录界面找回密码
	 * 
	 * @param webInput
	 * @param sysOpUser
	 */
	public CommonWebResult getLossPasswordBySysOpUser(PCPSWebInput webInput,
			SysOpUser sysOpUser) {
		try {
			sysOpUserBusinessImpl.getLossPasswordBySysOpUser(webInput,
					sysOpUser);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 重置密码
	 * 
	 * @param webInput
	 * @param sysOpUser
	 */
	public CommonWebResult resetSysOpUserPassword(PCPSWebInput webInput,
			SysOpUser sysOpUser) {

		commonDaoImpl.setSysLogPath(webInput);
		String _sysOpUser = null;
		try {
			_sysOpUser = sysOpUserBusinessImpl.resetSysOpUserPassword(webInput,
					sysOpUser);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		CommonWebResult cwr = new CommonWebResult();
		cwr.setResult(_sysOpUser);
		return cwr;
	}

	// 角色权限
	/**
	 * @角色分权限时根据菜单组选择所有服务
	 * @param menuGrpId
	 * @return
	 */
	public List<SysOpSap> getSysOpAclListByMenuGrpId(PCPSWebInput webInput,
			Integer menuGrpId) {

		commonDaoImpl.setSysLogPath(webInput);
		return sysOpSapDaoImpl.getSysOpAclListByMenuGrpId(menuGrpId);
	}

	/**
	 * @角色分权时根据角色查询角色当前菜单组服务
	 * @param roleId
	 * @param menuGrpId
	 * @return
	 */
	public List<SysOpSap> getSysOpAclListByRoleIdAndMenuGrpId(
			PCPSWebInput webInput, Integer roleId, Integer menuGrpId) {

		commonDaoImpl.setSysLogPath(webInput);
		return sysOpSapDaoImpl.getSysOpAclListByRoleIdAndMenuGrpId(roleId,
				menuGrpId);
	}

	/**
	 * @角色授权
	 * @param roleId
	 * @param sapIdList
	 */
	public CommonWebResult insertSysOpAclByRoleIdAndSapIdList(
			PCPSWebInput webInput, Integer menuGrpId, BigInteger roleId,
			List<BigInteger> sapIdList) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			sysOpSapDaoImpl.insertSysOpAclByRoleIdAndSapIdList(menuGrpId,
					roleId, sapIdList);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 证件类型
	@EJB(mappedName = "common.impl.IdTypeDaoImpl")
	private IdTypeDao idTypeDaoImpl;

	/**
	 * @根据主键查询证件类型
	 * @return
	 */
	public IdType getIdTypeByIdTypeId(BigInteger idTypeId) {
		return idTypeDaoImpl.getIdTypeByIdTypeId(idTypeId);
	}

	/**
	 * 查询证件类型列表，不分页
	 * 
	 * @return
	 */
	public List<IdType> getIdTypeIdList(PCPSWebInput webInput) {

		commonDaoImpl.setSysLogPath(webInput);
		return idTypeDaoImpl.getIdTypeIdList();
	}

	/**
	 * 根据分类查询证件类型列表，不分页
	 * 
	 * @return
	 */
	public List<IdType> getIdTypeIdListByCategory(PCPSWebInput webInput,
			String category) {

		commonDaoImpl.setSysLogPath(webInput);
		return idTypeDaoImpl.getIdTypeIdListByCategory(category);
	}

	/**
	 * 新增证件类型
	 * 
	 * @param idType
	 */
	public CommonWebResult insertIdType(PCPSWebInput webInput, IdType idType) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			idTypeDaoImpl.insertIdType(idType);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改证件类型
	 * 
	 * @param idType
	 */
	public CommonWebResult updateIdType(PCPSWebInput webInput, IdType idType) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			idTypeDaoImpl.updateIdType(idType);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据编号查询证件类型
	 * 
	 * @param idTypeNo
	 *            证件类型编号
	 * @throws PCPSApplicationException
	 */
	public IdType getIdTypeByIdTypeNo(String idTypeNo) {
		return idTypeDaoImpl.getIdTypeByIdTypeNo(idTypeNo);
	}

	// 黑名单
	@EJB(mappedName = "common.impl.BlackListBusinessImpl")
	private BlackListBusiness blackListBusinessImpl;
	@EJB(mappedName = "common.impl.BlackListDaoImpl")
	private BlackListDao blackListDaoImpl;

	/**
	 * 新增黑名单
	 * 
	 * @param blackList
	 */
	public CommonWebResult insertBlackListInfo(PCPSWebInput webInput,
			BlackList blackList) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			blackListBusinessImpl.insertBlackListInfo(webInput, blackList);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改黑名单
	 * 
	 * @param blackList
	 */
	public CommonWebResult updateBlackListInfo(PCPSWebInput webInput,
			BlackList blackList) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			blackListBusinessImpl.updateBlackListInfo(webInput, blackList);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 删除黑名单
	 * 
	 * @param blackList
	 */
	public CommonWebResult deleteBlackListInfo(PCPSWebInput webInput,
			BlackList blackList) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			blackListBusinessImpl.deleteBlackListInfo(webInput, blackList);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据组合主键查询
	 * 
	 * @param blackList
	 * @return
	 */
	public BlackList getBlackListByBlackList(PCPSWebInput webInput,
			BlackList blackList) {

		commonDaoImpl.setSysLogPath(webInput);
		return blackListDaoImpl.getBlackListByBlackList(blackList);
	}

	/**
	 * 根据姓名查询
	 * 
	 * @param name
	 * @return
	 */
	public List<BlackList> getBlackListByName(PCPSWebInput webInput, String name) {

		commonDaoImpl.setSysLogPath(webInput);
		return blackListDaoImpl.getBlackListByName(name);
	}

	/**
	 * 根据证件号查询
	 * 
	 * @param idNo
	 * @return
	 */
	public List<BlackList> getBlackListByIdNo(PCPSWebInput webInput, String idNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return blackListDaoImpl.getBlackListByIdNo(idNo);
	}

	/**
	 * 查询记录总数
	 * 
	 * @return
	 */
	public BigInteger getBlackListTotal() {
		return blackListDaoImpl.getBlackListTotal();
	}

	/**
	 * 分页查询
	 * 
	 * @param page
	 * @return
	 */
	public List<BlackList> getBlackListList(PCPSWebInput webInput, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return blackListDaoImpl.getBlackListList(page);
	}

	// 国家地区编码
	@EJB(mappedName = "common.impl.NationCodeDaoImpl")
	private NationCodeDao nationCodeDaoImpl;

	/**
	 * 根据主键查询
	 * 
	 * @param nationCodeId
	 * @return
	 */
	public NationCode getNationCodeByNationCodeId(String nationCodeId) {
		return nationCodeDaoImpl.getNationCodeByNationCodeId(nationCodeId);
	}

	/**
	 * 分页查询国家地区编码
	 * 
	 * @param page
	 * @return
	 */
	public List<NationCode> getNationCodeList(PCPSWebInput webInput,
			Integer page, String name) {

		commonDaoImpl.setSysLogPath(webInput);
		return nationCodeDaoImpl.getNationCodeList(page, name);
	}

	/**
	 * 国家地区编码记录数
	 * 
	 * @return
	 */
	public BigInteger getNationCodeTotal(String name) {
		return nationCodeDaoImpl.getNationCodeTotal(name);
	}

	// 国家地区编码
	@EJB(mappedName = "common.impl.RegionDaoImpl")
	private RegionDao regionDaoImpl;

	/**
	 * 根据主键编号查询
	 * 
	 * @param regionNo
	 * @return
	 */
	public Region getRegionByRegionNo(String regionNo) {
		return regionDaoImpl.getRegionByRegionNo(regionNo);
	}

	public List<Region> getRegionTreeList(String regionNo) {
		return regionDaoImpl.getRegionTreeList(regionNo);
	}

	/**
	 * 分层查询行政区域表
	 * 
	 * @param superRegionNo
	 *            父级编号
	 * @return
	 */
	public List<Region> getRegionList(String superRegionNo) {
		return regionDaoImpl.getRegionList(superRegionNo);
	}

	// 组织机构organization模块===========================start
	// 平台机构 SysBranch
	@EJB(mappedName = "organization.impl.SysBranchDaoImpl")
	private SysBranchDao sysBranchDaoImpl;

	/**
	 * 从发卡机构或销售机构中根据SysBranchSubord.SubBranchNo获取机构信息
	 * 
	 * @param subBranchNos
	 * @return
	 */
	public List<Object[]> getSysBrchInfoBySubBranchNos(String subBranchNos) {
		return sysBranchDaoImpl.getSysBrchInfoBySubBranchNos(subBranchNos);
	}

	/**
	 * @前台验证输入的编号是否存在
	 * @根据平台机构号查询平台机构
	 * @param branchNo
	 * @return
	 */
	public SysBranch getSysBranchByBranchNo(String branchNo) {
		return sysBranchDaoImpl.getSysBranchByBranchNo(branchNo);
	}

	public CommonWebResult deleteSysBranch(PCPSWebInput webInput,
			String branchNo) {
		try {
			sysBranchDaoImpl.deleteSysBranch(branchNo);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 发卡商渠道收益机构
	@EJB(mappedName = "organization.impl.IncomeBranchDaoImpl")
	private IncomeBranchDao incomeBranchDaoImpl;
	@EJB(mappedName = "organization.impl.IncomeBranchBusinessImpl")
	private IncomeBranchBusiness incomeBranchBusinessImpl;

	/**
	 * 根据主键查询
	 * 
	 * @param incomeBranchId
	 * @return
	 */
	public IncomeBranch getIncomeBranchByIncomeBranchId(
			BigInteger incomeBranchId) {
		return incomeBranchDaoImpl
				.getIncomeBranchByIncomeBranchId(incomeBranchId);
	}

	/**
	 * 根据发卡商编号查询发卡商渠道收益机构
	 * 
	 * @param issueCompanyNo
	 * @return
	 */
	public List<IncomeBranch> getIncomeBranchListByIssueCompanyNo(
			PCPSWebInput webInput, String issueCompanyNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return incomeBranchDaoImpl
				.getIncomeBranchListByIssueCompanyNo(issueCompanyNo);
	}

	/**
	 * 查询记录总数
	 * 
	 * @return
	 */
	public BigInteger getIncomeBranchTotal(PCPSWebInput webInput) {
		return incomeBranchDaoImpl.getIncomeBranchTotal(webInput);
	}

	/**
	 * 分页查询
	 * 
	 * @param page
	 * @return
	 */
	public List<IncomeBranch> getIncomeBranchList(PCPSWebInput webInput,
			Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return incomeBranchDaoImpl.getIncomeBranchList(webInput, page);
	}

	/**
	 * @新增发卡商渠道收益机构
	 * @param IncomeBranch
	 */
	public CommonWebResult insertIncomeBranchInfo(PCPSWebInput webInput,
			IncomeBranch incomeBranch) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			incomeBranchBusinessImpl.insertIncomeBranchInfo(webInput,
					incomeBranch);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @修改发卡商渠道收益机构
	 * @param IncomeBranch
	 */
	public CommonWebResult updateIncomeBranchInfo(PCPSWebInput webInput,
			IncomeBranch incomeBranch) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			incomeBranchBusinessImpl.updateIncomeBranchInfo(webInput,
					incomeBranch);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @删除发卡商渠道收益机构
	 * @param IncomeBranch
	 */
	public CommonWebResult deleteIncomeBranchInfo(PCPSWebInput webInput,
			String incomeBranchid) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			incomeBranchBusinessImpl.deleteIncomeBranch(webInput,
					incomeBranchid);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 发卡商
	@EJB(mappedName = "organization.impl.IssueCompanyBusinessImpl")
	private IssueCompanyBusiness issueCompanyBusinessImpl;
	@EJB(mappedName = "organization.impl.IssueCompanyDaoImpl")
	private IssueCompanyDao issueCompanyDaoImpl;

	/**
	 * @根据发卡商主键编号查询发卡商
	 * @param issueCompanyNo
	 * @return
	 */
	public IssueCompany getIssueCompanyByIssueCompanyNo(String issueCompanyNo) {
		return issueCompanyDaoImpl
				.getIssueCompanyByIssueCompanyNo(issueCompanyNo);
	}

	/**
	 * @根据发卡商名称查询发卡商
	 * @param issueCompanyName
	 * @return
	 */
	public IssueCompany getIssueCompanyByIssueCompanyName(
			String issueCompanyName) {
		return issueCompanyDaoImpl
				.getIssueCompanyByIssueCompanyName(issueCompanyName);
	}

	/**
	 * @分页查询
	 * @param page
	 * @param issueCompanyName
	 *            名称
	 * @return
	 */
	public List<IssueCompany> getIssueCompanyList(PCPSWebInput webInput,
			Integer page, String issueCompanyName) {

		commonDaoImpl.setSysLogPath(webInput);
		return issueCompanyDaoImpl.getIssueCompanyList(page, issueCompanyName);
	}

	/**
	 * 获取发卡商下拉列表
	 */
	public List<IssueCompany> getDropDownIssueCompany(PCPSWebInput webInput) {

		commonDaoImpl.setSysLogPath(webInput);
		return issueCompanyDaoImpl.getDropDownIssueCompany();
	}

	/**
	 * @查询表记录条数
	 * @param issueCompanyName
	 *            名称
	 * @return
	 */
	public BigInteger getIssueCompanyTotal(String issueCompanyName) {
		return issueCompanyDaoImpl.getIssueCompanyTotal(issueCompanyName);
	}

	/**
	 * @新增发卡商业务,新增前验证编号长度6位
	 * @param PCPSWebInput
	 *            登录用户信息
	 * @param issueCompany
	 */
	public CommonWebResult insertIssueCompanyInfo(PCPSWebInput webInput,
			IssueCompany issueCompany) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			issueCompanyBusinessImpl.insertIssueCompanyInfo(webInput,
					issueCompany);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @修改发卡商业务
	 * @param PCPSWebInput
	 *            登录用户信息
	 * @param issueCompany
	 */
	public CommonWebResult updateIssueCompanyInfo(PCPSWebInput webInput,
			IssueCompany issueCompany) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			issueCompanyBusinessImpl.updateIssueCompanyInfo(webInput,
					issueCompany);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 设置发卡商收益分配比率
	 * 
	 * @param webInput
	 *            日志记录对象
	 * @param issueCompany
	 *            发卡商
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult updateIssueCompanyCommissionRatio(PCPSWebInput web,
			IssueCompany ic) {

		commonDaoImpl.setSysLogPath(web);
		try {
			issueCompanyBusinessImpl.updateIssueCompanyCommissionRatio(web, ic);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @修改发卡商业务参数数据ONE
	 * @param PCPSWebInput
	 *            登录用户信息
	 * @param issueCompany
	 */
	public CommonWebResult updateIssueCompanyBaseInfo(PCPSWebInput webInput,
			IssueCompany issueCompany) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			issueCompanyBusinessImpl.updateIssueCompanyBaseInfo(webInput,
					issueCompany);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @修改发卡商业务参数数据TWO
	 * @param PCPSWebInput
	 *            登录用户信息
	 * @param issueCompany
	 */
	public CommonWebResult updateIssueCompanyBaseParameter(
			PCPSWebInput webInput, IssueCompany issueCompany) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			issueCompanyBusinessImpl.updateIssueCompanyBaseParameter(webInput,
					issueCompany);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @修改发卡商业务参数数据THREE
	 * @param PCPSWebInput
	 *            登录用户信息
	 * @param issueCompany
	 */
	public CommonWebResult updateIssueCompanyCardParameter(
			PCPSWebInput webInput, IssueCompany issueCompany) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			issueCompanyBusinessImpl.updateIssueCompanyCardParameter(webInput,
					issueCompany);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 发卡商资费标准
	@EJB(mappedName = "organization.impl.IssueFeePolicyDaoImpl")
	private IssueFeePolicyDao issueFeePolicyDaoImpl;
	@EJB(mappedName = "organization.impl.IssueFeePolicyBusinessImpl")
	private IssueFeePolicyBusiness issueFeePolicyBusinessImpl;

	/**
	 * 新增
	 * 
	 * @param input
	 * @param issueFeePolicy
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult insertIssueFeePolicy(PCPSWebInput input,
			IssueFeePolicy issueFeePolicy) {

		commonDaoImpl.setSysLogPath(input);
		try {
			issueFeePolicyBusinessImpl.insertIssueFeePolicy(input,
					issueFeePolicy);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改
	 * 
	 * @param input
	 * @param issueFeePolicy
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult updateIssueFeePolicy(PCPSWebInput input,
			IssueFeePolicy issueFeePolicy) {

		commonDaoImpl.setSysLogPath(input);
		try {
			issueFeePolicyBusinessImpl.updateIssueFeePolicy(input,
					issueFeePolicy);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 删除
	 * 
	 * @param input
	 * @param issueFeePolicy
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult deleteIssueFeePolicy(PCPSWebInput input,
			IssueFeePolicy issueFeePolicy) {

		commonDaoImpl.setSysLogPath(input);
		try {
			issueFeePolicyBusinessImpl.deleteIssueFeePolicy(input,
					issueFeePolicy);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 审核
	 * 
	 * @param input
	 * @param issueFeePolicy
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult authIssueFeePolicy(PCPSWebInput input,
			IssueFeePolicy issueFeePolicy) {

		commonDaoImpl.setSysLogPath(input);
		try {
			issueFeePolicyBusinessImpl
					.authIssueFeePolicy(input, issueFeePolicy);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 发卡商资费上下限
	@EJB(mappedName = "organization.impl.IssueFeePolicyLimitBusinessImpl")
	private IssueFeePolicyLimitBusiness issueFeePolicyLimitBusinessImpl;

	/**
	 * 新增发卡商资费上下限
	 * 
	 * @param webInput
	 * @param entity
	 * @return
	 */
	public CommonWebResult addIssueFeePolicyLimit(PCPSWebInput webInput,
			IssueFeePolicyLimit entity) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			issueFeePolicyLimitBusinessImpl.addIssueFeePolicyLimit(webInput,
					entity);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改发卡商资费上下限
	 * 
	 * @param webInput
	 * @param entity
	 * @return
	 */
	public CommonWebResult modifyIssueFeePolicyLimit(PCPSWebInput webInput,
			IssueFeePolicyLimit entity) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			issueFeePolicyLimitBusinessImpl.modifyIssueFeePolicyLimit(webInput,
					entity);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据发卡商号，获取发卡商资费上下限列表
	 * 
	 * @param webInput
	 * @return
	 */
	public List<IssueFeePolicyLimit> getIssueFeePolicyLimitListByCompNo(
			PCPSWebInput webInput, String businessType, Integer page) {
		try {
			return issueFeePolicyLimitBusinessImpl
					.getIssueFeePolicyLimitListByCompNo(webInput, businessType,
							page);
		} catch (PCPSApplicationException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	/**
	 * 总记录数
	 * 
	 * @param webInput
	 * @return
	 */
	public BigInteger getIssueFeePolicyLimitListTotal(PCPSWebInput webInput,
			String businessType) {
		try {
			return issueFeePolicyLimitBusinessImpl
					.getIssueFeePolicyLimitListTotal(webInput, businessType);
		} catch (PCPSApplicationException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return BigInteger.ZERO;
	}

	/**
	 * 获取发卡商资费上下限信息
	 * 
	 * @param webInput
	 * @param businessType
	 * @return
	 */
	public IssueFeePolicyLimit getIssueFeePolicyLimitByCompNoAndType(
			PCPSWebInput webInput, String businessType) {
		try {
			return issueFeePolicyLimitBusinessImpl
					.getIssueFeePolicyLimitByCompNoAndType(webInput,
							businessType);
		} catch (PCPSApplicationException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	/**
	 * 发卡商资费上下限生效审核
	 * 
	 * @param webInput
	 * @param businessType
	 * @param status
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult authIssueFeePolicyLimitEffective(
			PCPSWebInput webInput, String businessType, String authRemark) {
		commonDaoImpl.setSysLogPath(webInput);
		try {
			issueFeePolicyLimitBusinessImpl.authIssueFeePolicyLimitEffective(
					webInput, businessType, authRemark);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 计算发卡商业务资费
	 * 
	 * @param issueCompanyNo
	 *            发卡商号
	 * @param saleBranchNo
	 *            销售机构号(可选)
	 * @param businessType
	 *            业务类型
	 * @param cardNo
	 *            卡号
	 * @param toCardClassicId
	 *            目标卡种类(仅变更卡种类需要)
	 * @param tranDate
	 *            日期
	 * @param amount
	 *            发生额或余额
	 * @return
	 */
	// public SaleOrderResult calcCardHolderFee(String issueCompanyNo,
	// String saleBranchNo, String businessType, String cardNo,
	// BigInteger toCardClassicId, Date tranDate, BigInteger amount) {
	// IssueFeePolicy ifp = null;
	// try {
	// ifp = issueFeePolicyBusinessImpl.calcCardHolderFee(issueCompanyNo,
	// saleBranchNo, businessType, cardNo, toCardClassicId,
	// tranDate, amount);
	// } catch (PCPSApplicationException p) {
	// PCPSUtil.Log(p.getSubSysName(), p);
	// return new SaleOrderResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
	// p.getErrMsg());
	// } catch (Exception e) {
	// PCPSUtil.Log(e.getMessage(), e);
	// return new SaleOrderResult(PCPSUtil.FAILED,
	// CommonWebResult.THROW_EXCEPTION,
	// CommonWebResult.THROW_EXCEPTION_MSG);
	// }
	// SaleOrderResult sor = new SaleOrderResult();
	// sor.setIssueFeePolicy(ifp);
	// return sor;
	// }
	/**
	 * 计算发卡商业务资费
	 * 
	 * @param issueCompanyNo
	 *            发卡商号
	 * @param saleBranchNo
	 *            销售机构号(可选)
	 * @param businessType
	 *            业务类型
	 * @param cardNo
	 *            卡号
	 * @param cardSeqNo
	 *            卡序号
	 * @param cardFaceId
	 *            卡面ID
	 * @param cardClassicId
	 *            卡种类
	 * @param toCardClassicId
	 *            目标卡种类(仅变更卡种类需要)
	 * @param tranDate
	 *            日期
	 * @param amount
	 *            发生额或余额
	 * @param balance
	 *            卡余额
	 * @return
	 */
	public SaleOrderResult calcAllBusinessFee(PCPSWebInput webInput,
			String issueCompanyNo, String saleBranchNo, String businessType,
			String cardNo, String cardSeqNo, BigInteger cardFaceId,
			BigInteger cardClassicId, BigInteger toCardClassicId,
			Date tranDate, BigInteger amount, BigInteger balance) {

		commonDaoImpl.setSysLogPath(webInput);
		IssueFeePolicy ifp = null;
		try {
			ifp = issueFeePolicyBusinessImpl.calculateCardHolderFee(
					issueCompanyNo, saleBranchNo, businessType, cardNo,
					cardSeqNo, cardFaceId, cardClassicId, toCardClassicId,
					tranDate, amount, balance);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new SaleOrderResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new SaleOrderResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		SaleOrderResult sor = new SaleOrderResult();
		sor.setIssueFeePolicy(ifp);
		return sor;
	}

	/**
	 * 计算销售单手续费
	 * 
	 * @param list
	 *            销售信息列表
	 * @return
	 */
	public SaleOrderResult calcSaleOrderFee(PCPSWebInput webInput,
			List<IssueFeePolicy> list) {

		commonDaoImpl.setSysLogPath(webInput);
		IssueFeePolicy ifp = null;
		try {
			ifp = issueFeePolicyBusinessImpl.calcSaleOrderFee(list);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new SaleOrderResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new SaleOrderResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		SaleOrderResult sor = new SaleOrderResult();
		sor.setIssueFeePolicy(ifp);
		return sor;
	}

	/**
	 * 计算销售卡手续费
	 * 
	 * @param webInput
	 * @param saleBranchNo
	 * @param businessType
	 * @param startSeqNo
	 * @param endSeqNo
	 * @param cardFaceId
	 * @param cardClassicId
	 * @param cardParvalueId
	 * @return
	 */
	public SaleOrderResult calcSaleCardFee(PCPSWebInput webInput,
			String saleBranchNo, String businessType, String startSeqNo,
			String endSeqNo, BigInteger cardFaceId, BigInteger cardClassicId,
			BigInteger cardParvalueId, String calcSaleCardFee) {

		commonDaoImpl.setSysLogPath(webInput);
		IssueFeePolicy ifp = null;
		try {
			ifp = issueFeePolicyBusinessImpl.calcSaleCardFee(webInput,
					saleBranchNo, businessType, startSeqNo, endSeqNo,
					cardFaceId, cardClassicId, cardParvalueId, calcSaleCardFee);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new SaleOrderResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new SaleOrderResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		SaleOrderResult sor = new SaleOrderResult();
		sor.setIssueFeePolicy(ifp);
		return sor;
	}

	/**
	 * 计算充值卡手续费
	 * 
	 * @param webInput
	 * @param saleBranchNo
	 * @param businessType
	 * @param dodList
	 * @return
	 */
	public SaleOrderResult calcDepositCardFee(PCPSWebInput webInput,
			String saleBranchNo, String businessType,
			List<IssueFeePolicy> dodList) {

		commonDaoImpl.setSysLogPath(webInput);
		IssueFeePolicy ifp = null;
		try {
			ifp = issueFeePolicyBusinessImpl.calcDepositCardFee(webInput,
					saleBranchNo, businessType, dodList);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new SaleOrderResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new SaleOrderResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		SaleOrderResult sor = new SaleOrderResult();
		sor.setIssueFeePolicy(ifp);
		return sor;
	}

	/**
	 * 根据主键查询
	 * 
	 * @param feePolicyId
	 * @return
	 */
	public IssueFeePolicy getIssueFeePolicyByFeePolicyId(BigInteger feePolicyId) {
		return issueFeePolicyDaoImpl
				.getIssueFeePolicyByFeePolicyId(feePolicyId);
	}

	/**
	 * 分页查询列表
	 */
	public List<IssueFeePolicy> getIssueFeePolicyList(PCPSWebInput input,
			String businessType, BigInteger cardFaceId,
			BigInteger cardClassicId, String FeeType, String Status,
			Integer page) {

		commonDaoImpl.setSysLogPath(input);
		return issueFeePolicyDaoImpl.getIssueFeePolicyList(input, businessType,
				cardFaceId, cardClassicId, FeeType, Status, page);
	}

	/**
	 * 总记录数
	 */
	public BigInteger getIssueFeePolicyTotal(PCPSWebInput input,
			String businessType, BigInteger cardFaceId,
			BigInteger cardClassicId, String FeeType, String Status) {
		return issueFeePolicyDaoImpl.getIssueFeePolicyTotal(input,
				businessType, cardFaceId, cardClassicId, FeeType, Status);
	}

	// 发卡商分支机构
	@EJB(mappedName = "organization.impl.IssueBranchBusinessImpl")
	private IssueBranchBusiness issueBranchBusinessImpl;
	@EJB(mappedName = "organization.impl.IssueBranchDaoImpl")
	private IssueBranchDao issueBranchDaoImpl;

	/**
	 * @新增发卡商分支机构
	 * @param PCPSWebInput
	 *            登录用户信息
	 * @param issueBranch
	 */
	public CommonWebResult insertIssueBranchInfo(PCPSWebInput webInput,
			IssueBranch issueBranch) throws PCPSApplicationException {
		commonDaoImpl.setSysLogPath(webInput);
		try {
			issueBranchBusinessImpl
					.insertIssueBranchInfo(webInput, issueBranch);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @修改发卡商分支机构
	 * @param PCPSWebInput
	 *            登录用户信息
	 * @param issueBranch
	 */
	public CommonWebResult updateIssueBranchInfo(PCPSWebInput webInput,
			IssueBranch issueBranch) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			issueBranchBusinessImpl
					.updateIssueBranchInfo(webInput, issueBranch);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	public CommonWebResult deleteIssueBranch(PCPSWebInput webInput,
			String branchNo) throws PCPSApplicationException {
		commonDaoImpl.setSysLogPath(webInput);
		try {
			issueBranchBusinessImpl.deleteIssueBranchInfo(webInput, branchNo);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	public CommonWebResult updateIssueBranchActivateOrCredit(
			PCPSWebInput webInput, IssueBranch issueBranch) {
		commonDaoImpl.setSysLogPath(webInput);
		try {
			issueBranchBusinessImpl.updateIssueBranchActivateOrCredit(webInput,
					issueBranch);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @根据发卡商机构号查询发卡商分支机构
	 * @param issueBranchNo
	 * @return
	 */
	public IssueBranch getIssueBranchByIssueBranchNo(String issueBranchNo) {
		return issueBranchDaoImpl.getIssueBranchByIssueBranchNo(issueBranchNo);
	}

	/**
	 * @查询发卡商下有激活权限的发卡分支机构列表
	 * @param issueBranchNo
	 * @return
	 */
	public List<IssueBranch> getIssueBranchAllowActivateByIssueCompanyNo(
			String issueBranchNo) {
		return issueBranchDaoImpl
				.getIssueBranchAllowActivateByIssueCompanyNo(issueBranchNo);
	}

	/**
	 * @根据发卡商机构名称查询发卡商分支机构
	 * @param issueBranchName
	 * @return
	 */
	public IssueBranch getIssueBranchByIssueBranchName(String issueBranchName) {
		return issueBranchDaoImpl
				.getIssueBranchByIssueBranchName(issueBranchName);
	}

	/**
	 * @分页查询
	 * @param page
	 * @return
	 */
	public List<IssueBranch> getIssueBranchList(PCPSWebInput webInput,
			String issueBranchNo, String issueBranchName, String regionNo,
			String status, String allowActivate, Integer page) {
		commonDaoImpl.setSysLogPath(webInput);
		return issueBranchDaoImpl.getIssueBranchList(webInput, issueBranchNo,
				issueBranchName, regionNo, status, allowActivate, page);
	}

	/**
	 * @查询表记录条数
	 * @return
	 */
	public BigInteger getIssueBranchTotal(PCPSWebInput webInput,
			String issueBranchNo, String issueBranchName, String regionNo,
			String status, String allowActivate) {
		return issueBranchDaoImpl.getIssueBranchTotal(webInput, issueBranchNo,
				issueBranchName, regionNo, status, allowActivate);
	}

	/**
	 * 获取调拨机构下拉列表
	 * 
	 * @param webInput
	 * @return
	 */
	public List<DropdownList> getTransferBrachDropDownListBy(
			PCPSWebInput webInput) {
		commonDaoImpl.setSysLogPath(webInput);
		return issueBranchDaoImpl.getTransferBrachDropDownListBy(webInput);
	}

	/**
	 * 根据发卡机构号，时间段查询授信额度结余统计表
	 * 
	 */
	public List<Object[]> getCreditAccDetailByIssueBranch(
			PCPSWebInput webInput, String issueBranchNo, String startdate,
			String enddate) {
		commonDaoImpl.setSysLogPath(webInput);
		return issueBranchDaoImpl.getCreditAccDetailByIssueBranch(webInput,
				issueBranchNo, startdate, enddate);
	}

	// 销售机构
	@EJB(mappedName = "organization.impl.SaleBranchBusinessImpl")
	private SaleBranchBusiness saleBranchBusinessImpl;
	@EJB(mappedName = "organization.impl.SaleBranchDaoImpl")
	private SaleBranchDao saleBranchDaoImpl;

	/**
	 * @根据销售商分支机构主键编号查询销售商分支机构
	 * @param issueCompanyNo
	 * @return
	 */
	public SaleBranch getSaleBranchBySaleBranchNo(String saleBranchNo) {
		return saleBranchDaoImpl.getSaleBranchBySaleBranchNo(saleBranchNo);
	}

	/**
	 * 获取销售机构自动生成顺序号
	 * 
	 * @param saleBranchNo
	 * @param regionNo
	 * @return
	 */
	public String getAutoSaleBranchSeqNo(String saleBranchNo, String regionNo) {
		return saleBranchDaoImpl.getAutoSaleBranchSeqNo(saleBranchNo, regionNo);
	}

	/**
	 * @根据销售商分支机构名称查询销售商分支机构
	 * @param SaleBranchName
	 * @return
	 */
	public SaleBranch getSaleBranchBySaleBranchName(String saleBranchName) {
		return saleBranchDaoImpl.getSaleBranchBySaleBranchName(saleBranchName);
	}

	/**
	 * @分页查询销售商机构
	 * @param page
	 * @return
	 */
	public List<SaleBranch> getSaleBranchList(PCPSWebInput webInput,
			String saleBranchNo, String saleBranchName, String regionNo,
			Integer page) {
		commonDaoImpl.setSysLogPath(webInput);
		return saleBranchDaoImpl.getSaleBranchList(webInput, saleBranchNo,
				saleBranchName, regionNo, page);
	}

	/**
	 * @查询表记录条数
	 * @return
	 */
	public BigInteger getSaleBranchTotal(PCPSWebInput webInput,
			String saleBranchNo, String saleBranchName, String regionNo) {
		return saleBranchDaoImpl.getSaleBranchTotal(webInput, saleBranchNo,
				saleBranchName, regionNo);
	}

	/**
	 * 机构金额分类查询
	 * 
	 * @param webInput
	 * @param searchType
	 *            OverCash 现金库超限查询 Cash 现金库查询 Credit预存款查询
	 * @param saleBranchNo
	 *            机构号
	 * @param startMoney
	 *            起始金额
	 * @param endMoney
	 *            终止金额
	 * @return
	 */
	public List<SaleBranch> getSerchSaleBranchCashListByCondition(
			PCPSWebInput webInput, String searchType, String saleBranchNo,
			BigInteger startMoney, BigInteger endMoney, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return saleBranchDaoImpl.getSerchSaleBranchCashListByCondition(
				webInput, searchType, saleBranchNo, startMoney, endMoney, page);
	}

	public BigInteger getSerchSaleBranchCashTotalByCondition(
			PCPSWebInput webInput, String searchType, String saleBranchNo,
			BigInteger startMoney, BigInteger endMoney) {
		return saleBranchDaoImpl.getSerchSaleBranchCashTotalByCondition(
				webInput, searchType, saleBranchNo, startMoney, endMoney);
	}

	public CommonWebResult deleteSaleBranchInfo(PCPSWebInput webInput,
			String branchNo) {
		commonDaoImpl.setSysLogPath(webInput);
		try {
			saleBranchBusinessImpl.deleteSaleBranchInfo(webInput, branchNo);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @销售商分支机构新增前验证编号长度
	 * @param PCPSWebInput
	 *            登录用户信息
	 * @param SaleCompany
	 */
	public CommonWebResult insertSaleBranchInfo(PCPSWebInput webInput,
			SaleBranch saleBranch) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			saleBranchBusinessImpl.insertSaleBranchInfo(webInput, saleBranch);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @修改销售商分支机构
	 * 
	 * @param PCPSWebInput
	 *            登录用户信息
	 * @param SaleBranch
	 */
	public CommonWebResult updateSaleBranchInfo(PCPSWebInput webInput,
			SaleBranch saleBranch) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			saleBranchBusinessImpl.updateSaleBranchInfo(webInput, saleBranch);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改销售机构预存款下限
	 * 
	 * @param webInput
	 * @param saleBranch
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult updateSaleBranchCreditLowLimit(
			PCPSWebInput webInput, SaleBranch saleBranch) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			saleBranchBusinessImpl.updateSaleBranchCreditLowLimit(webInput,
					saleBranch);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 商圈
	@EJB(mappedName = "organization.impl.BusinessDistrictDaoImpl")
	private BusinessDistrictDao businessDistrictDaoImpl;
	@EJB(mappedName = "organization.impl.BusinessDistrictBusinessImpl")
	private BusinessDistrictBusiness businessDistrictBusinessImpl;

	/**
	 * @根据编号查询商圈
	 * @param businessDistrictId
	 * @return
	 */
	public BusinessDistrict getBusinessDistrictByBusinessDistrictId(
			BigInteger businessDistrictId) {
		return businessDistrictDaoImpl
				.getBusinessDistrictByBusinessDistrictId(businessDistrictId);
	}

	/**
	 * 根据发卡商编号查询商圈下拉
	 * 
	 * @param webInput
	 * @return
	 */
	public List<BusinessDistrict> getBusinessDistrictDropdownList(
			PCPSWebInput webInput) {

		commonDaoImpl.setSysLogPath(webInput);
		return businessDistrictDaoImpl
				.getBusinessDistrictDropdownList(webInput);
	}

	/**
	 * @总记录数
	 * @return
	 */
	public BigInteger getBusinessDistrictTotal(PCPSWebInput webInput) {
		return businessDistrictDaoImpl.getBusinessDistrictTotal(webInput);
	}

	/**
	 * @分页查询
	 * @param page
	 * @return
	 */
	public List<BusinessDistrict> getBusinessDistrictList(
			PCPSWebInput webInput, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return businessDistrictDaoImpl.getBusinessDistrictList(webInput, page);
	}

	/**
	 * @新增商圈
	 * @param PCPSWebInput
	 *            登录用户信息
	 * @param businessDistrict
	 */
	public CommonWebResult insertBusinessDistrict(PCPSWebInput webInput,
			BusinessDistrict businessDistrict) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			businessDistrictBusinessImpl.insertBusinessDistrictInfo(webInput,
					businessDistrict);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @修改商圈
	 * @param PCPSWebInput
	 *            登录用户信息
	 * @param businessDistrict
	 */
	public CommonWebResult updateBusinessDistrict(PCPSWebInput webInput,
			BusinessDistrict businessDistrict) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			businessDistrictBusinessImpl.updateBusinessDistrictInfo(webInput,
					businessDistrict);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 删除商圈
	 * 
	 * @param webInput
	 * @param businessDistrict
	 * @return
	 */
	public CommonWebResult removeBusinessDistrict(PCPSWebInput webInput,
			BusinessDistrict businessDistrict) {
		commonDaoImpl.setSysLogPath(webInput);
		try {
			businessDistrictBusinessImpl.removeBusinessDistrictInfo(webInput,
					businessDistrict);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 审核商圈
	 * 
	 * @param webInput
	 * @param businessDistrict
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult authBusinessDistrict(PCPSWebInput webInput,
			BusinessDistrict businessDistrict) throws PCPSApplicationException {
		commonDaoImpl.setSysLogPath(webInput);
		try {
			businessDistrictBusinessImpl.authBusinessDistrict(webInput,
					businessDistrict);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 拒绝审核商圈
	 * 
	 * @param webInput
	 * @param businessDistrict
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult unAuthBusinessDistrict(PCPSWebInput webInput,
			BusinessDistrict businessDistrict) throws PCPSApplicationException {
		commonDaoImpl.setSysLogPath(webInput);
		try {
			businessDistrictBusinessImpl.unAuthBusinessDistrict(webInput,
					businessDistrict);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 发卡商销售商以及机构下拉
	@EJB(mappedName = "organization.impl.SysBranchSubordDaoImpl")
	private SysBranchSubordDao sysBranchSubordDaoImpl;

	/**
	 * 根据登录用户归属机构号获取发卡商以及发卡商机构信息
	 * 
	 * @param branchNo
	 * @return
	 */
	public List<OrganTreeList> getSysBranchSubordListByBranchNo(
			PCPSWebInput webInput, String branchNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return sysBranchSubordDaoImpl
				.getSysBranchSubordListByBranchNo(branchNo);
	}

	/**
	 * 根据登录用户归属机构号获取所有机构信息
	 * 
	 * @param branchNo
	 * @return
	 */
	public List<OrganTreeList> getAllSysBranchSubordListByBranchNo(
			PCPSWebInput webInput, String branchNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return sysBranchSubordDaoImpl
				.getAllSysBranchSubordListByBranchNo(branchNo);
	}

	/**
	 * 根据机构号查询下属销售机构列表
	 * 
	 * @param branchNo
	 *            机构号
	 * @return List 平台机构隶属关系列表
	 */
	public List<OrganTreeList> getReportSysBranchSubordListByBranchNo(
			PCPSWebInput webInput, String branchNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return sysBranchSubordDaoImpl
				.getReportSysBranchSubordListByBranchNo(branchNo);
	}

	/**
	 * 根据机构号查询下属发卡商分支机构列表
	 * 
	 * @param branchNo
	 *            机构号
	 * @return List 平台机构隶属关系列表
	 */
	public String getReportAllIssueBranchListByBranchNo(PCPSWebInput webInput,
			String subBranchType, String branchNo) {
		return sysBranchSubordDaoImpl.getReportAllSaleBranchListByBranchNo(
				subBranchType, branchNo);
	}

	// 机构下层机构
	public List<SysBranchSubord> getNextLevelBranchNoList(String branchNo) {
		return sysBranchSubordDaoImpl.getNextLevelBranchNoList(branchNo);
	}

	/**
	 * 根据机构号查询下属销售商分支机构列表
	 * 
	 * @param branchNo
	 *            机构号
	 * @return List 平台机构隶属关系列表
	 */
	public List<SysBranchSubord> getAllSaleBranchListByBranchNo(
			PCPSWebInput webInput, String branchNo) {
		commonDaoImpl.setSysLogPath(webInput);
		return sysBranchSubordDaoImpl.getAllSaleBranchListByBranchNo(branchNo);
	}

	public CommonWebResult deleteSysBranchSubord(PCPSWebInput webInput,
			String branchNo) {
		try {
			sysBranchSubordDaoImpl.deleteSysBranchSubord(branchNo);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据机构号查询下属发卡商分支机构列表
	 * 
	 * @param branchNo
	 *            机构号
	 * @return List 平台机构隶属关系列表
	 */
	public List<SysBranchSubord> getAllIssueBranchListByBranchNo(
			PCPSWebInput webInput, String branchNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return sysBranchSubordDaoImpl.getAllIssueBranchListByBranchNo(branchNo);
	}

	// 商圈绑定商户
	@EJB(mappedName = "organization.impl.BusinessDistrictMerchantDaoImpl")
	private BusinessDistrictMerchantDao businessDistrictMerchantDaoImpl;

	/**
	 * 根据主键查询
	 * 
	 * @param businessDistrictMerchant
	 * @return
	 */
	public BusinessDistrictMerchant getBusinessDistrictMerchantByPrimaryKey(
			BusinessDistrictMerchant businessDistrictMerchant) {
		return businessDistrictMerchantDaoImpl
				.getBusinessDistrictMerchantByPrimaryKey(businessDistrictMerchant);
	}

	/**
	 * 根据商圈编号查询商户列表
	 * 
	 * @param businessDistrictId
	 * @return
	 */
	public List<BusinessDistrictMerchant> getBusinessDistrictMerchantListByBusinessDistrictId(
			PCPSWebInput webInput, BigInteger businessDistrictId) {

		commonDaoImpl.setSysLogPath(webInput);
		return businessDistrictMerchantDaoImpl
				.getBusinessDistrictMerchantListByBusinessDistrictId(businessDistrictId);
	}

	/**
	 * 插入商圈绑定商户
	 * 
	 * @param bdmList
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult insertBusinessDistrictMerchantByList(
			PCPSWebInput webInput, BigInteger businessDistrictId,
			List<BusinessDistrictMerchant> bdmList) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			businessDistrictMerchantDaoImpl
					.insertBusinessDistrictMerchantByList(businessDistrictId,
							bdmList);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据商户号获取商圈列表
	 * 
	 * @param branchNo
	 * @return
	 */
	public List<BusinessDistrict> getBusinessDistrictByBranchNO(String branchNo) {
		return businessDistrictMerchantDaoImpl
				.getBusinessDistrictByBranchNO(branchNo);
	}

	/**
	 * 新增
	 * 
	 * @param businessDistrictMerchant
	 */
	public CommonWebResult insertBusinessDistrictMerchant(
			PCPSWebInput webInput,
			BusinessDistrictMerchant businessDistrictMerchant) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			businessDistrictMerchantDaoImpl
					.insertBusinessDistrictMerchant(businessDistrictMerchant);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改
	 * 
	 * @param businessDistrictMerchant
	 */
	public CommonWebResult updateBusinessDistrictMerchant(
			PCPSWebInput webInput,
			BusinessDistrictMerchant businessDistrictMerchant) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			businessDistrictMerchantDaoImpl
					.updateBusinessDistrictMerchant(businessDistrictMerchant);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 查询商户已绑定的商圈
	 * 
	 * @param merchantNo
	 * @return
	 */
	public List<BusinessDistrictMerchant> getBusinessDistrictMerchantListByMerchantNo(
			PCPSWebInput webInput, String merchantNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return businessDistrictMerchantDaoImpl
				.getBusinessDistrictMerchantListByMerchantNo(merchantNo);
	}

	// /**
	// * 商户绑定商圈
	// *
	// * @param bdmList
	// */
	// public CommonWebResult insertBusinessDistrictMerchantByList(
	// String merchantNo, BigInteger[] arrInt) {
	// try {
	// businessDistrictMerchantDaoImpl
	// .insertBusinessDistrictMerchantByList(merchantNo, arrInt);
	// } catch (PCPSApplicationException p) {
	// return PCPSException(p);
	// } catch (Exception e) {
	// return CommonException(e);
	// }
	// return new CommonWebResult();
	// }

	/**
	 * 登录所属发卡商下列表
	 * 
	 * @param webInput
	 * @param page
	 * @return
	 */
	public List<BusinessDistrictMerchant> getBusinessDistrictMerchantList(
			PCPSWebInput webInput, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return businessDistrictMerchantDaoImpl.getBusinessDistrictMerchantList(
				webInput, page);
	}

	/**
	 * 登录所属发卡商下记录数
	 * 
	 * @param webInput
	 * @return
	 */
	public BigInteger getBusinessDistrictMerchantTotal(PCPSWebInput webInput) {
		return businessDistrictMerchantDaoImpl
				.getBusinessDistrictMerchantTotal(webInput);
	}

	// 商业类型
	@EJB(mappedName = "organization.impl.MerchantTypeDaoImpl")
	private MerchantTypeDao merchantTypeDaoImpl;

	/**
	 * 根据主键查询商业类型
	 * 
	 * @param merchantTypeId
	 * @return
	 */
	public MerchantType getMerchantTypeByMerchantTypeId(
			BigInteger merchantTypeId) {
		return merchantTypeDaoImpl
				.getMerchantTypeByMerchantTypeId(merchantTypeId);
	}

	/**
	 * 商业类型列表
	 * 
	 * @param merchantTypeName
	 * @param page
	 * @return
	 */
	public List<MerchantType> getMerchantTypeListByCondition(
			PCPSWebInput webInput, String merchantTypeName, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantTypeDaoImpl.getMerchantTypeListByCondition(
				merchantTypeName, page);
	}

	/**
	 * 商业类型记录数
	 * 
	 * @param merchantTypeName
	 * @return
	 */
	public BigInteger getMerchantTypeTotalByCondition(String merchantTypeName) {
		return merchantTypeDaoImpl
				.getMerchantTypeTotalByCondition(merchantTypeName);
	}

	/**
	 * 新增商业类型
	 * 
	 * @param MerchantType
	 */
	public CommonWebResult insertMerchantType(PCPSWebInput webInput,
			MerchantType merchantType) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantTypeDaoImpl.insertMerchantType(merchantType);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改商业类型
	 * 
	 * @param MerchantType
	 */
	public CommonWebResult updateMerchantType(PCPSWebInput webInput,
			MerchantType merchantType) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantTypeDaoImpl.updateMerchantType(merchantType);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 删除商业类型
	 * 
	 * @param MerchantTypeId
	 */
	public CommonWebResult deleteMerchantTypeByMerchantTypeId(
			PCPSWebInput webInput, BigInteger merchantTypeId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantTypeDaoImpl
					.deleteMerchantTypeByMerchantTypeId(merchantTypeId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 商业类型列表
	 * 
	 * @param merchantTypeName
	 * @param page
	 * @return
	 */
	public List<MerchantType> getMerchantTypeList(PCPSWebInput webInput) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantTypeDaoImpl.getMerchantTypeList();
	}

	// 商户
	@EJB(mappedName = "organization.impl.MerchantBusinessImpl")
	private MerchantBusiness merchantBusinessImpl;
	@EJB(mappedName = "organization.impl.MerchantDaoImpl")
	private MerchantDao merchantDaoImpl;

	/**
	 * 发卡商下商户下拉,过滤掉无效商户
	 * 
	 * @param issueCompanyNo
	 * @return 发卡商下商户列表
	 */
	public List<Merchant> getActivateMerchantListByIssueCompanyNo(
			String issueCompanyNo) {
		return merchantDaoImpl
				.getActivateMerchantListByIssueCompanyNo(issueCompanyNo);
	}

	/**
	 * 根据商户编号查询
	 * 
	 * @param merchantNo
	 * @return
	 */
	public Merchant getMerchantByMerchantNo(String merchantNo) {
		return merchantDaoImpl.getMerchantByMerchantNo(merchantNo);
	}

	/**
	 * 自动生成特约商户编号
	 * 
	 * @param webInput
	 * @param branchNo机构号
	 * @param regionNo区域号
	 * @return
	 */
	public String getAutoMerchantNo(String branchNo, String regionNo) {
		return merchantDaoImpl.getAutoMerchantNo(branchNo, regionNo);
	}

	/**
	 * 根据商户名称查询
	 * 
	 * @param merchantName
	 * @return
	 */
	public Merchant getMerchantByMerchantName(String merchantName) {
		return merchantDaoImpl.getMerchantByMerchantName(merchantName);
	}

	/**
	 * 查询总记录数
	 * 
	 * @param branchNo
	 *            商户所属编号
	 * @return
	 */
	public BigInteger getMerchantTotal(PCPSWebInput webInput,
			String merchantNo, String merchantName, BigInteger merchantTypeId,
			BigInteger incomeBranchId, String channelMode, String regionNo) {
		return merchantDaoImpl.getMerchantTotal(webInput, merchantNo,
				merchantName, merchantTypeId, incomeBranchId, channelMode,
				regionNo);
	}

	/**
	 * 分页查询
	 * 
	 * @param page
	 * @param branchNo
	 *            商户所属编号
	 * @return
	 */
	public List<Merchant> getMerchantList(PCPSWebInput webInput,
			String merchantNo, String merchantName, BigInteger merchantTypeId,
			BigInteger incomeBranchId, String channelMode, String regionNo,
			Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantDaoImpl.getMerchantList(webInput, merchantNo,
				merchantName, merchantTypeId, incomeBranchId, channelMode,
				regionNo, page);
	}

	/**
	 * 根据开发单位机构号查询商户列表
	 * 
	 * @param webInput
	 * @param developBranchNo
	 * @return
	 */
	public List<Merchant> getMerchantByDevelopBranchNo(PCPSWebInput webInput,
			String developBranchNo) {
		commonDaoImpl.setSysLogPath(webInput);
		return merchantDaoImpl.getMerchantByDevelopBranchNo(developBranchNo);
	}

	/**
	 * 根据渠道模式检索商户清单
	 * 
	 * @param channelMode
	 *            渠道模式
	 * @param webInput
	 * @return
	 */
	public List<Merchant> getMerchantByChannelMode(PCPSWebInput webInput,
			String channelMode) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantDaoImpl.getMerchantByChannelMode(webInput, channelMode);
	}

	/**
	 * 根据商户编号检索商户名称
	 * 
	 * @param webInput
	 * @param merchantno
	 * @return
	 */
	public List<Object[]> getMerchantDaySettlementList(PCPSWebInput webInput,
			String merchantno) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantDaoImpl.getMerchantList(webInput, merchantno);
	}

	/**
	 * 发卡商下商户下拉
	 * 
	 * @param issueCompanyNo
	 * @return
	 */
	public List<Merchant> getMerchantListByIssueCompanyNo(
			PCPSWebInput webInput, String issueCompanyNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantDaoImpl.getMerchantListByIssueCompanyNo(issueCompanyNo);
	}

	/**
	 * @新增特约商户
	 * @param PCPSWebInput
	 *            登录用户信息
	 * @param merchant
	 */
	public CommonWebResult insertMerchantInfo(PCPSWebInput webInput,
			Merchant merchant) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantBusinessImpl.insertMerchantInfo(webInput, merchant);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @修改特约商户
	 * @param PCPSWebInput
	 *            登录用户信息
	 * @param merchant
	 */
	public CommonWebResult updateMerchantInfo(PCPSWebInput webInput,
			Merchant merchant) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantBusinessImpl.updateMerchantInfo(webInput, merchant);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	public CommonWebResult deleteMerchant(PCPSWebInput webInput,
			String merchantNo) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantBusinessImpl.deleteMerchant(webInput, merchantNo);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 持卡人商户消费手续费（MerchantPaidFee）
	@EJB(mappedName = "organization.impl.MerchantPaidFeeDaoImpl")
	private MerchantPaidFeeDao merchantPaidFeeDaoImpl;
	@EJB(mappedName = "organization.impl.MerchantPaidFeeBusinessImpl")
	private MerchantPaidFeeBusiness merchantPaidFeeBusinessImpl;

	/**
	 * 根据商户号、业务类型查询
	 * 
	 * @param merchantNo
	 *            商户号
	 * @param businessType
	 *            业务类型
	 * @return MerchantPaidFee
	 */
	public MerchantPaidFee getMerchantPaidFeeByKey(PCPSWebInput webInput,
			String merchantNo, String businessType) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantPaidFeeDaoImpl.getMerchantPaidFeeByKey(merchantNo,
				businessType);
	}

	/**
	 * 分页查询持卡人商户消费手续费列表
	 * 
	 * @param webInput
	 * @param businessType
	 * @param businessName
	 * @param page
	 * @return
	 */
	public List<MerchantPaidFee> getMerchantPaidFeeList(PCPSWebInput webInput,
			String merchantNo, String businessType, String businessName,
			Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantPaidFeeDaoImpl.getMerchantPaidFeeList(webInput,
				merchantNo, businessType, businessName, page);
	}

	/**
	 * 查询持卡人商户消费手续费记录数
	 * 
	 * @param webInput
	 * @param businessType
	 * @param businessName
	 * @return
	 */
	public BigInteger getMerchantPaidFeeTotal(PCPSWebInput webInput,
			String merchantNo, String businessType, String businessName) {
		return merchantPaidFeeDaoImpl.getMerchantPaidFeeTotal(webInput,
				merchantNo, businessType, businessName);
	}

	/**
	 * 新增
	 * 
	 * @param webInput
	 * @param merchantPaidFee
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult insertMerchantPaidFeeInfo(PCPSWebInput webInput,
			MerchantPaidFee merchantPaidFee) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantPaidFeeBusinessImpl.insertMerchantPaidFeeInfo(webInput,
					merchantPaidFee);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改
	 * 
	 * @param webInput
	 * @param merchantPaidFee
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult updateMerchantPaidFeeInfo(PCPSWebInput webInput,
			MerchantPaidFee merchantPaidFee) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantPaidFeeBusinessImpl.updateMerchantPaidFeeInfo(webInput,
					merchantPaidFee);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 删除
	 * 
	 * @param webInput
	 * @param merchantPaidFee
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult deleteMerchantPaidFeeInfo(PCPSWebInput webInput,
			MerchantPaidFee merchantPaidFee) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantPaidFeeBusinessImpl.deleteMerchantPaidFeeInfo(webInput,
					merchantPaidFee);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 商户手续费收入结算策略浮动
	@EJB(mappedName = "organization.impl.MerchantFeeSettlementPolicyBusinessImpl")
	private MerchantFeeSettlementPolicyBusiness merchantFeeSettlementPolicyBusinessImpl;
	@EJB(mappedName = "organization.impl.MerchantFeeSettlementPolicyDaoImpl")
	private MerchantFeeSettlementPolicyDao merchantFeeSettlementPolicyDaoImpl;

	/**
	 * 新增
	 * 
	 * @param merchantFeeSettlePolicyFloat
	 */
	public CommonWebResult insertMerchantFeeSettlementPolicyInfo(
			PCPSWebInput webInput,
			MerchantFeeSettlementPolicy merchantFeeSettlementPolicy) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantFeeSettlementPolicyBusinessImpl
					.insertMerchantFeeSettlementPolicyInfo(webInput,
							merchantFeeSettlementPolicy);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改
	 * 
	 * @param MerchantFeeSettlementPolicy
	 */
	public CommonWebResult updateMerchantFeeSettlementPolicyInfo(
			PCPSWebInput webInput,
			MerchantFeeSettlementPolicy merchantFeeSettlementPolicy) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantFeeSettlementPolicyBusinessImpl
					.updateMerchantFeeSettlementPolicyInfo(webInput,
							merchantFeeSettlementPolicy);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 审核
	public CommonWebResult auditMerchantFeeSettlementPolicyInfo(
			PCPSWebInput webInput, MerchantFeeSettlementPolicy mfsp) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantFeeSettlementPolicyBusinessImpl
					.auditMerchantFeeSettlementPolicyInfo(webInput, mfsp);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据主键查询
	 * 
	 * @param feePolicyId
	 * @return
	 */
	public MerchantFeeSettlementPolicy getMerchantFeeSettlementPolicyByFeePolicyId(
			BigInteger feePolicyId) {
		return merchantFeeSettlementPolicyDaoImpl
				.getMerchantFeeSettlementPolicyByFeePolicyId(feePolicyId);
	}

	/**
	 * 记录列表
	 * 
	 * @param webInput
	 * @param page
	 * @return
	 */
	public List<MerchantFeeSettlementPolicy> getMerchantFeeSettlementPolicyList(
			PCPSWebInput webInput, String merchantNo, String status,
			String policy, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantFeeSettlementPolicyDaoImpl
				.getMerchantFeeSettlementPolicyList(webInput, merchantNo,
						status, policy, page);
	}

	/**
	 * 记录数
	 * 
	 * @param webInput
	 * @param page
	 * @return
	 */
	public BigInteger getMerchantFeeSettlementPolicyTotal(
			PCPSWebInput webInput, String merchantNo, String status,
			String policy) {
		return merchantFeeSettlementPolicyDaoImpl
				.getMerchantFeeSettlementPolicyTotal(webInput, merchantNo,
						status, policy);
	}

	/**
	 * 根据商户号和合同号,获取对应策略列表
	 * 
	 * @param webInput
	 * @param merchantNo
	 * @param contractId
	 * @return
	 */
	public List<MerchantFeeSettlementPolicy> getMFSPListForContract(
			PCPSWebInput webInput, String merchantNo, String contractId,
			Integer page) {
		return merchantFeeSettlementPolicyDaoImpl.getMFSPListForContract(
				webInput, merchantNo, contractId, page);
	}

	/**
	 * 根据商户号和合同号,获取对应策略列表
	 * 
	 * @param webInput
	 * @param merchantNo
	 * @param contractId
	 * @return
	 */
	public BigInteger getMFSPTotalForContract(PCPSWebInput webInput,
			String merchantNo, String contractId) {
		return merchantFeeSettlementPolicyDaoImpl.getMFSPTotalForContract(
				webInput, merchantNo, contractId);
	}

	/**
	 * 根据商户号和合同号,获取对应策略数目
	 * 
	 * @param merchantNo
	 * @param contractId
	 * @param policy
	 * @return
	 */
	public Integer checkMFSPTotalForContract(String merchantNo,
			String contractId, String policy) {
		return merchantFeeSettlementPolicyDaoImpl.checkMFSPTotalForContract(
				merchantNo, contractId, policy);
	}

	// 商户分支机构
	@EJB(mappedName = "organization.impl.MerchantBranchDaoImpl")
	private MerchantBranchDao merchantBranchDaoImpl;
	@EJB(mappedName = "organization.impl.MerchantBranchBusinessImpl")
	private MerchantBranchBusiness merchantBranchBusinessImpl;

	/**
	 * @新增商户机构
	 * @param PCPSWebInput
	 *            登录用户信息
	 * @param merchant
	 */
	public CommonWebResult insertMerchantBranchInfo(PCPSWebInput webInput,
			MerchantBranch merchantBranch) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantBranchBusinessImpl.insertMerchantBranchInfo(webInput,
					merchantBranch);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @修改商户机构
	 * @param PCPSWebInput
	 *            登录用户信息
	 * @param MerchantBranch
	 */
	public CommonWebResult updateMerchantBranchInfo(PCPSWebInput webInput,
			MerchantBranch merchantBranch) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantBranchBusinessImpl.updateMerchantBranchInfo(webInput,
					merchantBranch);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	public CommonWebResult deleteMerchantBranch(PCPSWebInput webInput,
			String mrchNo) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantBranchBusinessImpl.deleteMerchantBranch(webInput, mrchNo);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据商户编号查询
	 * 
	 * @param merchantNo
	 * @return
	 */
	public MerchantBranch getMerchantBranchByMerchantBranchNo(
			String merchantBranchNo) {
		return merchantBranchDaoImpl
				.getMerchantBranchByMerchantBranchNo(merchantBranchNo);
	}

	/**
	 * 根据商户号查询商户分支机构下拉树
	 * 
	 * @param merchantNo
	 * @return
	 */
	public List<OrganTreeList> getMerchantBranchListByMerchantNo(
			PCPSWebInput webInput, String merchantNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantBranchDaoImpl
				.getMerchantBranchListByMerchantNo(merchantNo);
	}

	/**
	 * 查询总记录数
	 * 
	 * @param branchNo
	 * @return
	 */
	public BigInteger getMerchantBranchTotal(PCPSWebInput webInput,
			String merchantBranchNo, String merchantBranchName, String regionNo) {
		return merchantBranchDaoImpl.getMerchantBranchTotal(webInput,
				merchantBranchNo, merchantBranchName, regionNo);
	}

	/**
	 * 分页查询
	 * 
	 * @param branchNo
	 *            用户所属机构
	 * @param page
	 * @return
	 */
	public List<MerchantBranch> getMerchantBranchList(PCPSWebInput webInput,
			String merchantBranchNo, String merchantBranchName,
			String regionNo, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantBranchDaoImpl.getMerchantBranchList(webInput,
				merchantBranchNo, merchantBranchName, regionNo, page);
	}

	/**
	 * 根据条件查询商户分支机构
	 * 
	 * @param webInput
	 * @param merchantNo
	 * @param merchantBranchNo
	 * @param merchantBranchName
	 * @param page
	 * @return
	 */
	public List<MerchantBranch> getMerchantBranchByCondition(
			PCPSWebInput webInput, String merchantNo, String merchantBranchNo,
			String merchantBranchName, Integer page) {
		// 设置日志记录文件
		commonDaoImpl.setSysLogPath(webInput);
		return merchantBranchDaoImpl.getMerchantBranchByCondition(merchantNo,
				merchantBranchNo, merchantBranchName, page);
	}

	public BigInteger getMerchantBranchByConditionTotal(PCPSWebInput webInput,
			String merchantNo, String merchantBranchNo,
			String merchantBranchName) {
		return merchantBranchDaoImpl.getMerchantBranchByConditionTotal(
				merchantNo, merchantBranchNo, merchantBranchName);
	}

	public String getAutoMerchantBranchSeqNo(String mrchBranchNo,
			String regionNo) {
		return merchantBranchDaoImpl.getAutoMerchantBranchSeqNo(mrchBranchNo,
				regionNo);
	}

	/**
	 * 组织机构organization模块===========================end
	 */
	/**
	 * 销售管理salesmanage模块===========================start
	 */
	// 销售员
	@EJB(mappedName = "salesmanage.impl.SalesDaoImpl")
	private SalesDao salesDaoImpl;
	@EJB(mappedName = "salesmanage.impl.SalesBusinessImpl")
	private SalesBusiness salesBusinessImpl;

	/**
	 * @新增销售员业务
	 * @param PCPSWebInput
	 *            登录用户信息
	 * @param Sales
	 */
	public CommonWebResult insertSalesInfo(PCPSWebInput webInput, Sales sales) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			salesBusinessImpl.insertSalesInfo(webInput, sales);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @修改销售员业务
	 * @param PCPSWebInput
	 *            登录用户信息
	 * @param Sales
	 */
	public CommonWebResult updateSalesInfo(PCPSWebInput webInput, Sales sales) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			salesBusinessImpl.updateSalesInfo(webInput, sales);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据销售员信息编号查询
	 * 
	 * @param merchantNo
	 * @return
	 */
	public Sales getSalesBySalesNo(BigInteger salesId) {
		return salesDaoImpl.getSalesBySalesNo(salesId);
	}

	/**
	 * 根据销售员信息名称查询
	 * 
	 * @param SalesName
	 * @return
	 */
	public Sales getSalesBySalesName(String salesName) {
		return salesDaoImpl.getSalesBySalesName(salesName);
	}

	/**
	 * 查询总记录数
	 * 
	 * @param branchNo
	 *            用户所属机构
	 * @return
	 */
	public BigInteger getSalesTotal(PCPSWebInput webInput, String branchNo,
			String salesName) {
		return salesDaoImpl.getSalesTotal(webInput, branchNo, salesName);
	}

	/**
	 * 分页查询
	 * 
	 * @param branchNo
	 *            用户所属机构
	 * @param page
	 * @return
	 */
	public List<Sales> getSalesList(PCPSWebInput webInput, Integer page,
			String branchNo, String salesName) {

		commonDaoImpl.setSysLogPath(webInput);
		return salesDaoImpl.getSalesList(webInput, page, branchNo, salesName);
	}

	/**
	 * 根据销售机构查询销售员下拉列表
	 * 
	 * @param saleBranchNo
	 * @return
	 */
	public List<Sales> getSalesListBySaleBranchNo(PCPSWebInput webInput,
			String saleBranchNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return salesDaoImpl.getSalesListBySaleBranchNo(saleBranchNo);
	}

	// 职业级别
	@EJB(mappedName = "salesmanage.impl.ProfessionDaoImpl")
	private ProfessionDao professionDaoImpl;

	public Profession getProfessionByProfessionId(BigInteger professionId) {
		return professionDaoImpl.getProfessionByProfessionId(professionId);
	}

	public Profession getProfessionByProfessionNo(String professionNo) {
		return professionDaoImpl.getProfessionByProfessionNo(professionNo);
	}

	/**
	 * 查询一级职业信息
	 * 
	 * @return
	 */
	public List<Profession> getFirstProfessionList() {
		return professionDaoImpl.getFirstProfessionList();
	}

	public List<Profession> getProfessionList(String superprofessionno) {
		return professionDaoImpl.getProfessionList(superprofessionno);
	}

	// 个人客户管理
	@EJB(mappedName = "salesmanage.impl.PersonalCustomBusinessImpl")
	private PersonalCustomBusiness personalCustomBusinessImpl;
	@EJB(mappedName = "salesmanage.impl.PersonalCustomDaoImpl")
	private PersonalCustomDao personalCustomDaoImpl;

	/**
	 * 根据发卡商号和身份证号查询
	 * 
	 * @param issueCompanyNO
	 * @param idNO
	 * @return
	 */
	public PersonalCustom getPersonalCustomByIdNOAndIssueCompanyNO(
			String issueCompanyNO, String idNo) {
		return personalCustomDaoImpl.getPersonalCustomByIdNOAndIssueCompanyNO(
				issueCompanyNO, idNo);
	}

	/**
	 * 根据主键查询个人客户信息
	 * 
	 * @param personalId
	 * @return
	 */
	public PersonalCustom getPersonalCustomByPersonalId(BigInteger personalId) {
		return personalCustomDaoImpl.getPersonalCustomByPersonalId(personalId);
	}

	/**
	 * 根据姓名和证件号模糊查询当前登录操作员所在发卡商内个人客户信息
	 * 
	 * @param webInput
	 * @param page
	 * @param name
	 * @param idNo
	 * @return
	 */
	public List<PersonalCustom> getPersonalCustomListByNameOrIdNo(
			PCPSWebInput webInput, Integer page, String name, String idNo,
			String linkTel) {

		commonDaoImpl.setSysLogPath(webInput);
		return personalCustomDaoImpl.getPersonalCustomListByNameOrIdNo(
				webInput, page, name, idNo, linkTel);
	}

	/**
	 * 根据姓名和证件号模糊查询当前登录操作员所在发卡商内个人客户信息记录数
	 * 
	 * @param webInput
	 * @param page
	 * @param name
	 * @param idNo
	 * @return
	 */
	public BigInteger getPersonalCustomTotalByNameOrIdNo(PCPSWebInput webInput,
			String name, String idNo, String linkTel) {
		return personalCustomDaoImpl.getPersonalCustomTotalByNameOrIdNo(
				webInput, name, idNo, linkTel);
	}

	/**
	 * 新增
	 * 
	 * @param personalCustom
	 */
	public CommonWebResult insertPersonalCustomInfo(PCPSWebInput webInput,
			PersonalCustom personalCustom) {

		commonDaoImpl.setSysLogPath(webInput);
		BigInteger res = null;
		try {
			res = personalCustomBusinessImpl.insertPersonalCustomInfo(webInput,
					personalCustom);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		CommonWebResult cwr = new CommonWebResult();
		cwr.setResult(res.toString());
		return cwr;
	}

	/**
	 * 修改
	 * 
	 * @param personalCustom
	 */
	public CommonWebResult updatePersonalCustomInfo(PCPSWebInput webInput,
			PersonalCustom personalCustom) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			personalCustomBusinessImpl.updatePersonalCustomInfo(webInput,
					personalCustom);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 客户风险等级统计表----报表
	 * 
	 * @param startdatetime
	 *            创建起始时间
	 * @param enddatetime
	 *            创建终止时间
	 * @param riskLevel
	 *            风险等级
	 * @return
	 */
	public List<Object[]> getPersonalCustomByRiskLevel(PCPSWebInput webInput,
			Date startdatetime, Date enddatetime, String riskLevel)
			throws PCPSApplicationException {

		commonDaoImpl.setSysLogPath(webInput);
		return personalCustomDaoImpl.getPersonalCustomByRiskLevel(webInput,
				startdatetime, enddatetime, riskLevel);
	}

	// 单位客户管理
	@EJB(mappedName = "salesmanage.impl.OrganizeCustomBusinessImpl")
	private OrganizeCustomBusiness organizeCustomBusinessImpl;
	@EJB(mappedName = "salesmanage.impl.OrganizeCustomDaoImpl")
	private OrganizeCustomDao organizeCustomDaoImpl;

	/**
	 * 新增
	 * 
	 * @param personalCustom
	 */
	public CommonWebResult insertOrganizeCustomInfo(PCPSWebInput webInput,
			OrganizeCustom organizeCustom) {

		commonDaoImpl.setSysLogPath(webInput);
		BigInteger res = BigInteger.ZERO;
		try {
			res = organizeCustomBusinessImpl.insertOrganizeCustomInfo(webInput,
					organizeCustom);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		CommonWebResult cwr = new CommonWebResult();
		cwr.setResult(res.toString());
		return cwr;
	}

	/**
	 * 修改
	 * 
	 * @param OrganizeCustom
	 */
	public CommonWebResult updateOrganizeCustomInfo(PCPSWebInput webInput,
			OrganizeCustom organizeCustom) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			organizeCustomBusinessImpl.updateOrganizeCustomInfo(webInput,
					organizeCustom);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据主键查询单位信息
	 * 
	 * @param personalId
	 * @return
	 */
	public OrganizeCustom getOrganizeCustomByOrganizeId(BigInteger organizeId) {
		return organizeCustomDaoImpl.getOrganizeCustomByOrganizeId(organizeId);
	}

	/**
	 * 分页查询
	 * 
	 * @param page
	 * @return
	 */
	public List<OrganizeCustom> getOrganizeCustomList(PCPSWebInput webInput,
			Integer page, String fullName, String telephone) {

		commonDaoImpl.setSysLogPath(webInput);
		return organizeCustomDaoImpl.getOrganizeCustomList(webInput, page,
				fullName, telephone);
	}

	/**
	 * 总记录数
	 * 
	 * @return
	 */
	public BigInteger getOrganizeCustomTotal(PCPSWebInput webInput,
			String fullName, String telephone) {
		return organizeCustomDaoImpl.getOrganizeCustomTotal(webInput, fullName,
				telephone);
	}

	// 行业等级
	@EJB(mappedName = "salesmanage.impl.IndustryDaoImpl")
	private IndustryDao industryDaoImpl;

	public Industry getIndustryByIndustryId(BigInteger industryId) {
		return industryDaoImpl.getIndustryByIndustryId(industryId);
	}

	public List<Industry> getFirstIndustryList() {
		return industryDaoImpl.getFirstIndustryList();
	}

	/**
	 * 下拉树
	 * 
	 * @return
	 */
	public List<Industry> getIndustryList(String superindustryno) {
		return industryDaoImpl.getIndustryList(superindustryno);
	}

	public Industry getIndustryByIndustryNo(String IndustryNo) {
		return industryDaoImpl.getIndustryByIndustryNo(IndustryNo);
	}

	// 单位证件明细信息
	@EJB(mappedName = "salesmanage.impl.OrganizeInfDetailBusinessImpl")
	private OrganizeInfDetailBusiness organizeInfDetailBusinessImpl;
	@EJB(mappedName = "salesmanage.impl.OrganizeInfDetailDaoImpl")
	private OrganizeInfDetailDao organizeInfDetailDaoImpl;

	/**
	 * 新增
	 * 
	 * @param OrganizeCustom
	 */
	public CommonWebResult insertOrganizeInfDetailInfo(PCPSWebInput webInput,
			OrganizeInfDetail organizeInfDetail) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			organizeInfDetailBusinessImpl.insertOrganizeInfDetailInfo(webInput,
					organizeInfDetail);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改
	 * 
	 * @param OrganizeInfDetail
	 */
	public CommonWebResult updateOrganizeInfDetailInfo(PCPSWebInput webInput,
			OrganizeInfDetail organizeInfDetail) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			organizeInfDetailBusinessImpl.updateOrganizeInfDetailInfo(webInput,
					organizeInfDetail);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据主键查询单位证件明细信息
	 * 
	 * @param organizeInfDetail
	 * @return
	 */
	public OrganizeInfDetail getOrganizeInfDetailByOrganizeInfDetail(
			OrganizeInfDetail organizeInfDetail) {
		return organizeInfDetailDaoImpl
				.getOrganizeInfDetailByOrganizeInfDetail(organizeInfDetail);
	}

	/**
	 * 查询单个单位证件明细信息
	 * 
	 * @param issueCompanyNo
	 * @return
	 */
	public List<OrganizeInfDetail> getOrganizeInfDetailByOrganizeId(
			PCPSWebInput webInput, BigInteger organizeId) {

		commonDaoImpl.setSysLogPath(webInput);
		return organizeInfDetailDaoImpl
				.getOrganizeInfDetailByOrganizeId(organizeId);
	}

	/**
	 * 分页查询
	 * 
	 * @param page
	 * @return
	 */
	public List<OrganizeInfDetail> getOrganizeInfDetailList(
			PCPSWebInput webInput, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return organizeInfDetailDaoImpl
				.getOrganizeInfDetailList(webInput, page);
	}

	/**
	 * 总记录数
	 * 
	 * @return
	 */
	public BigInteger getOrganizeInfDetailTotal(PCPSWebInput webInput) {
		return organizeInfDetailDaoImpl.getOrganizeInfDetailTotal(webInput);
	}

	// 销售单
	@EJB(mappedName = "salesmanage.impl.SaleOrderDaoImpl")
	private SaleOrderDao saleOrderDaoImpl;
	@EJB(mappedName = "salesmanage.impl.SaleOrderBusinessImpl")
	private SaleOrderBusiness saleOrderBusinessImpl;

	/**
	 * 根据主键查询销售单
	 * 
	 * @param saleOrderId
	 * @return
	 */
	public SaleOrder getSaleOrderBySaleOrderId(BigInteger saleOrderId) {
		return saleOrderDaoImpl.getSaleOrderBySaleOrderId(saleOrderId);
	}

	public SaleOrder getSaleOrderBySaleOrderSeqNo(String saleOrderSeqNo) {
		return saleOrderDaoImpl.getSaleOrderBySaleOrderSeqNo(saleOrderSeqNo);
	}

	/**
	 * 营销员业务统计表
	 * 
	 * @param input
	 * @param branchNo
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public List<Object[]> getSalesFromSaleOrddr(PCPSWebInput input,
			String branchNo, String startDate, String endDate) {
		return saleOrderDaoImpl.getSalesFromSaleOrddr(input, branchNo,
				startDate, endDate);
	}

	/**
	 * 组合查询销售单
	 * 
	 * @param buyerType
	 *            购卡人类型
	 * @param name
	 *            购卡人姓名
	 * @param orderStatus
	 *            销售单状态
	 * @param startSaleAmount
	 *            起始销售单售卡金额
	 * @param endSaleAmount
	 *            终止销售单售卡金额
	 * @param startTime
	 *            起始销售时间
	 * @param endTime
	 *            终止销售时间
	 * @param saleBranchNo
	 *            销售批次号
	 * @param btnStatus
	 *            前台传入那种查询状态
	 * @param page
	 *            分页页码
	 * @return
	 */
	public List<SaleOrder> getSaleOrderListByCondition(PCPSWebInput webInput,
			String orderSeqNo, String buyerType, String name,
			String orderStatus, BigInteger startSaleAmount,
			BigInteger endSaleAmount, String startTime, String endTime,
			String saleBranchNo, String btnStatus, String paidType,
			String feeType, Integer page) {
		commonDaoImpl.setSysLogPath(webInput);
		return saleOrderDaoImpl.getSaleOrderListByCondition(webInput,
				orderSeqNo, buyerType, name, orderStatus, startSaleAmount,
				endSaleAmount, startTime, endTime, saleBranchNo, btnStatus,
				paidType, feeType, page);
	}

	/**
	 * 组合查询销售单
	 * 
	 * @param buyerType
	 *            购卡人类型
	 * @param name
	 *            购卡人姓名
	 * @param orderStatus
	 *            销售单状态
	 * @param startSaleAmount
	 *            起始销售单售卡金额
	 * @param endSaleAmount
	 *            终止销售单售卡金额
	 * @param startTime
	 *            起始销售时间
	 * @param endTime
	 *            终止销售时间
	 * @param saleBranchNo
	 *            销售批次号
	 * @param btnStatus
	 *            前台传入那种查询状态
	 * @return
	 */
	public BigInteger getSaleOrderTotalByCondition(PCPSWebInput webInput,
			String orderSeqNo, String buyerType, String name,
			String orderStatus, BigInteger startSaleAmount,
			BigInteger endSaleAmount, String startTime, String endTime,
			String saleBranchNo, String btnStatus, String paidType,
			String feeType) {
		return saleOrderDaoImpl.getSaleOrderTotalByCondition(webInput,
				orderSeqNo, buyerType, name, orderStatus, startSaleAmount,
				endSaleAmount, startTime, endTime, saleBranchNo, btnStatus,
				paidType, feeType);
	}

	/**
	 * 组合查询销售单Sum
	 * 
	 * @param buyerType
	 *            购卡人类型
	 * @param name
	 *            购卡人姓名
	 * @param orderStatus
	 *            销售单状态
	 * @param startSaleAmount
	 *            起始销售单售卡金额
	 * @param endSaleAmount
	 *            终止销售单售卡金额
	 * @param startTime
	 *            起始销售时间
	 * @param endTime
	 *            终止销售时间
	 * @param saleBranchNo
	 *            销售批次号
	 * @param btnStatus
	 *            前台传入那种查询状态
	 * @param page
	 *            分页页码
	 * @return
	 */
	public Object[] getSaleOrderListByConditionSum(PCPSWebInput webInput,
			String orderSeqNo, String buyerType, String name,
			String orderStatus, BigInteger startSaleAmount,
			BigInteger endSaleAmount, String startTime, String endTime,
			String saleBranchNo, String btnStatus, String paidType,
			String feeType) {
		commonDaoImpl.setSysLogPath(webInput);
		return saleOrderDaoImpl.getSaleOrderListByConditionSum(webInput,
				orderSeqNo, buyerType, name, orderStatus, startSaleAmount,
				endSaleAmount, startTime, endTime, saleBranchNo, btnStatus,
				paidType, feeType);
	}

	/**
	 * 授信付款的销售单查询列表
	 * 
	 * @param webInput
	 * @param orderSeqNo
	 * @param startTime
	 * @param endTime
	 * @param saleBranchNo
	 * @param page
	 * @return
	 */
	public List<SaleOrder> getSaleOrderCreditPayListByCondition(
			PCPSWebInput webInput, String orderSeqNo, String startTime,
			String endTime, String saleBranchNo, Integer page) {
		return saleOrderDaoImpl.getSaleOrderCreditPayListByCondition(webInput,
				orderSeqNo, startTime, endTime, saleBranchNo, page);
	}

	/**
	 * 授信付款的销售单查询总数
	 * 
	 * @param webInput
	 * @param orderSeqNo
	 * @param startTime
	 * @param endTime
	 * @param saleBranchNo
	 * @return
	 */
	public BigInteger getSaleOrderCreditPayTotalByCondition(
			PCPSWebInput webInput, String orderSeqNo, String startTime,
			String endTime, String saleBranchNo) {
		return saleOrderDaoImpl.getSaleOrderCreditPayTotalByCondition(webInput,
				orderSeqNo, startTime, endTime, saleBranchNo);
	}

	/**
	 * 打包激活销售单列表
	 * 
	 * @param webInput
	 * @param orderSeqNo
	 * @param startSaleAmount
	 * @param endSaleAmount
	 * @param startTime
	 * @param endTime
	 * @param saleBranchNo
	 * @return
	 */
	public List<SaleOrder> getActivateSaleOrderList(PCPSWebInput webInput,
			String orderSeqNo, BigInteger startSaleAmount,
			BigInteger endSaleAmount, String startTime, String endTime,
			String saleBranchNo, String activateBranchNo, String orderStatus,
			String paidType, String feeType) {
		return saleOrderDaoImpl.getActivateSaleOrderList(webInput, orderSeqNo,
				startSaleAmount, endSaleAmount, startTime, endTime,
				saleBranchNo, activateBranchNo, orderStatus, paidType, feeType);
	}

	/**
	 * 打包激活销售单列表SUM
	 * 
	 * @param webInput
	 * @param orderSeqNo
	 * @param startSaleAmount
	 * @param endSaleAmount
	 * @param startTime
	 * @param endTime
	 * @param saleBranchNo
	 * @return
	 */
	public Object[] getActivateSaleOrderListSum(PCPSWebInput webInput,
			String orderSeqNo, BigInteger startSaleAmount,
			BigInteger endSaleAmount, String startTime, String endTime,
			String saleBranchNo, String activateBranchNo, String orderStatus,
			String paidType, String feeType) {
		return saleOrderDaoImpl.getActivateSaleOrderListSum(webInput,
				orderSeqNo, startSaleAmount, endSaleAmount, startTime, endTime,
				saleBranchNo, activateBranchNo, orderStatus, paidType, feeType);
	}

	/**
	 * 卡类报表 卡销售明细表
	 * 
	 * @param branchNo
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public List<Object[]> getSaleOrderListReportByCond(PCPSWebInput webInput,
			String branchNo, String startDate, String endDate) {
		return saleOrderDaoImpl.getSaleOrderListReportByCond(webInput,
				branchNo, startDate, endDate);
	}

	public List<Object[]> getSaleOrderCardDetailReportBySaleOrderId(
			BigInteger saleOrderId) {
		return saleOrderCardDetailDaoImpl
				.getSaleOrderCardDetailReportBySaleOrderId(saleOrderId);
	}

	/**
	 * 卡销售统计表 激活的销售单
	 * 
	 * @param webInput
	 * @param branchNo
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public List<Object[]> getSaleOrderCountReportByCond(PCPSWebInput webInput,
			String branchNo, String startDate, String endDate) {
		return saleOrderDaoImpl.getSaleOrderCountReportByCond(webInput,
				branchNo, startDate, endDate);
	}

	/**
	 * 根据激活单查询销售单列表
	 * 
	 * @param activeOrderId
	 * @return
	 */
	public List<SaleOrder> getSaleOrderListByActiveOrderId(
			PCPSWebInput webInput, BigInteger activeOrderId, String btnStatus) {
		commonDaoImpl.setSysLogPath(webInput);
		return saleOrderDaoImpl.getSaleOrderListByActiveOrderId(activeOrderId,
				btnStatus);
	}

	/**
	 * 打印销售单时凭证出库
	 * 
	 * @param webInput
	 * @param saleOrderId
	 * @param voucherId
	 * @param voucherNo
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult updateSaleOrderVoucherNo(PCPSWebInput webInput,
			BigInteger saleOrderId, String voucherNo) {
		commonDaoImpl.setSysLogPath(webInput);
		try {
			saleOrderBusinessImpl.updateSaleOrderVoucherNo(webInput,
					saleOrderId, voucherNo);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 选择激活销售单
	 * 
	 * @param webInput
	 * @param saleOrderIds
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult updateSaleOrderActivateBranchNo(
			PCPSWebInput webInput, BigInteger[] saleOrderIds,
			BigInteger bankAccDetailId) throws PCPSApplicationException {
		commonDaoImpl.setSysLogPath(webInput);
		try {
			saleOrderBusinessImpl.updateSaleOrderActivateBranchNo(webInput,
					saleOrderIds, bankAccDetailId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 售卡时检查卡是否可卖，获取卡面信息
	 * 
	 * @param webInput
	 * @param socd
	 * @return CardFace 备注中为当前卡批次剩余库存
	 * @throws PCPSApplicationException
	 */
	public SaleOrderResult getSaleOrderCardFace(PCPSWebInput webInput,
			SaleOrderCardDetail socd) {

		commonDaoImpl.setSysLogPath(webInput);
		CardFace so = null;
		try {
			so = saleOrderBusinessImpl.getSaleOrderCardFace(webInput, socd);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new SaleOrderResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new SaleOrderResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		SaleOrderResult sor = new SaleOrderResult();
		sor.setCardFace(so);
		return sor;
	}

	/**
	 * 创建销售单录入全部参数
	 * 
	 * @param webInput
	 * @param saleOrder
	 * @param cardDetailList
	 * @param salesDetailList
	 * @param realNameList
	 * @param paidDetailList
	 * @return
	 * @throws PCPSApplicationException
	 */
	public SaleOrderResult createSaleOrder(PCPSWebInput webInput,
			SaleOrder saleOrder, List<SaleOrderCardDetail> cardDetailList,
			List<SaleOrderSalesDetail> salesDetailList,
			List<SaleOrderRealNameDetail> realNameList,
			List<SaleOrderPaidDetail> paidDetailList) {

		commonDaoImpl.setSysLogPath(webInput);
		SaleOrder so = null;
		try {
			so = saleOrderBusinessImpl.createSaleOrder(webInput, saleOrder,
					cardDetailList, salesDetailList, realNameList,
					paidDetailList);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new SaleOrderResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new SaleOrderResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new SaleOrderResult(so);
	}

	/**
	 * 销售单授信付款补录
	 * 
	 * @param webInput
	 * @param sopd
	 * @return
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult paySaleOrderCredit(PCPSWebInput webInput,
			SaleOrderPaidDetail sopd) throws PCPSApplicationException {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			saleOrderBusinessImpl.paySaleOrderCredit(webInput, sopd);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 授信付款撤销
	 * 
	 * @param webInput
	 * @param sopd
	 * @return
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult cancelSaleOrderCredit(PCPSWebInput webInput,
			SaleOrderPaidDetail sopd) throws PCPSApplicationException {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			saleOrderBusinessImpl.cancelSaleOrderCredit(webInput, sopd);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 销售单撤销
	 */
	public SaleOrderResult cancelSaleOrder(PCPSWebInput webInput,
			SaleOrder saleOrder) {

		commonDaoImpl.setSysLogPath(webInput);
		SaleOrder so = null;
		try {
			so = saleOrderBusinessImpl.cancelSaleOrder(webInput, saleOrder);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new SaleOrderResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new SaleOrderResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new SaleOrderResult(so);
	}

	/**
	 * 销售单主管授权
	 * 
	 * @param webInput
	 * @param autherName
	 * @param autherPass
	 * @return 返回BigInteger.ZERO,授权失败
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult authCreateSaleOrder(PCPSWebInput webInput,
			String autherName, String autherPass) {

		commonDaoImpl.setSysLogPath(webInput);
		BigInteger res = BigInteger.ZERO;
		try {
			res = saleOrderBusinessImpl.authCreateSaleOrder(webInput,
					autherName, autherPass);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		CommonWebResult cwr = new CommonWebResult();
		cwr.setResult(res.toString());
		return cwr;
	}

	/**
	 * 销售单审核卡
	 * 
	 * @param webInput
	 * @param saleOrderIds
	 * @param status
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult authSaleOrderCard(PCPSWebInput webInput,
			BigInteger[] saleOrderIds) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			saleOrderBusinessImpl.authSaleOrderCard(webInput, saleOrderIds);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 销售单资金审核
	 * 
	 * @param webInput
	 * @param saleOrderIds
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult authSaleOrderMoney(PCPSWebInput webInput,
			BigInteger[] saleOrderIds) {
		commonDaoImpl.setSysLogPath(webInput);
		try {
			saleOrderBusinessImpl.authSaleOrderMoney(webInput, saleOrderIds);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 单个销售单资金审核
	public CommonWebResult authOneSaleOrderMoney(PCPSWebInput webInput,
			BigInteger b) {
		commonDaoImpl.setSysLogPath(webInput);
		try {
			saleOrderBusinessImpl.authOneSaleOrderMoney(webInput, b);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 判断销售单付款是否包含现金
	 * 
	 * @param saleOrders
	 * @return
	 */
	public boolean checkCashSaleOrder(BigInteger[] saleOrders) {
		return saleOrderBusinessImpl.checkCashSaleOrder(saleOrders);
	}

	/**
	 * 根据条件检索销售单信息列表--报表（西邮寄卡实名制信息统计表）
	 * 
	 * @param saleBranchNo
	 *            销售机构
	 * @param buyerType
	 *            购卡人类型
	 * @return
	 */
	public List<Object[]> getSaleOrderByRealName(PCPSWebInput webInput,
			String saleBranchNo, Date sratDate, Date endDate) {

		commonDaoImpl.setSysLogPath(webInput);
		return saleOrderDaoImpl.getSaleOrderByRealName(webInput, saleBranchNo,
				sratDate, endDate);
	}

	// 销售单售卡明细
	@EJB(mappedName = "salesmanage.impl.SaleOrderCardDetailDaoImpl")
	private SaleOrderCardDetailDao saleOrderCardDetailDaoImpl;

	/**
	 * 根据主键查询
	 * 
	 * @param saleOrderCardDetail
	 * @return
	 */
	public SaleOrderCardDetail getSaleOrderCardDetailByPrimaryKey(
			SaleOrderCardDetail saleOrderCardDetail) {
		return saleOrderCardDetailDaoImpl
				.getSaleOrderCardDetailByPrimaryKey(saleOrderCardDetail);
	}

	/**
	 * 销售单售卡信息
	 * 
	 * @param saleOrderId
	 * @return
	 */
	public List<SaleOrderCardDetail> getSaleOrderCardDetailListBySaleOrderId(
			PCPSWebInput webInput, BigInteger saleOrderId) {

		commonDaoImpl.setSysLogPath(webInput);
		return saleOrderCardDetailDaoImpl
				.getSaleOrderCardDetailListBySaleOrderId(saleOrderId);
	}

	/**
	 * 根据卡序号获取销售单序号
	 * 
	 * @param cardSeqNo
	 * @return
	 */
	public SaleOrder getSaleOrderSeqNoByCardSeqNo(PCPSWebInput webInput,
			String cardSeqNo) {
		return saleOrderDaoImpl.getSaleOrderByCardSeqNo(webInput, cardSeqNo);
	}

	/**
	 * 根据条件查询销售单售卡明细记录
	 * 
	 * @param saleOrderId
	 * @return
	 */
	public List<SaleOrderCardDetail> getSaleOrderCardDetailListByCondition(
			PCPSWebInput webInput, BigInteger saleOrderId, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return saleOrderCardDetailDaoImpl
				.getSaleOrderCardDetailListByCondition(saleOrderId, page);
	}

	/**
	 * 根据条件查询销售单售卡明细记录数
	 * 
	 * @param saleOrderId
	 * @return
	 */
	public BigInteger getSaleOrderCardDetailTotalByCondition(
			BigInteger saleOrderId) {
		return saleOrderCardDetailDaoImpl
				.getSaleOrderCardDetailTotalByCondition(saleOrderId);
	}

	// 销售员明细
	@EJB(mappedName = "salesmanage.impl.SaleOrderSalesDetailDaoImpl")
	private SaleOrderSalesDetailDao saleOrderSalesDetailDaoImpl;

	/**
	 * 查询一个销售单下销售员明细
	 * 
	 * @param saleOrderId
	 * @return
	 */
	public List<SaleOrderSalesDetail> getSaleOrderSalesDetailListBySaleOrderIdAndPage(
			PCPSWebInput webInput, BigInteger saleOrderId, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return saleOrderSalesDetailDaoImpl
				.getSaleOrderSalesDetailListBySaleOrderIdAndPage(saleOrderId,
						page);
	}

	/**
	 * 单个销售单下销售员记录数
	 * 
	 * @param saleOrderId
	 * @return
	 */
	public BigInteger getSaleOrderSalesDetailTotalBySaleOrderId(
			BigInteger saleOrderId) {
		return saleOrderSalesDetailDaoImpl
				.getSaleOrderSalesDetailTotalBySaleOrderId(saleOrderId);
	}

	// 销售单持卡人实名明细
	@EJB(mappedName = "salesmanage.impl.SaleOrderRealNameDetailDaoImpl")
	private SaleOrderRealNameDetailDao saleOrderRealNameDetailDaoImpl;

	/**
	 * 根据销售单编号查询该销售单持卡人实名明细
	 * 
	 * @param saleOrderId
	 * @return
	 */
	public List<SaleOrderRealNameDetail> getAllSaleOrderRealNameDetailList(
			PCPSWebInput webInput, BigInteger saleOrderId) {

		commonDaoImpl.setSysLogPath(webInput);
		return saleOrderRealNameDetailDaoImpl
				.getAllSaleOrderRealNameDetailList(saleOrderId);
	}

	/**
	 * 根据条件查询持卡人实名信息列表
	 * 
	 * @param saleOrderId
	 * @param batchNo
	 * @param cardNo
	 * @param startCardSeqNo
	 * @param endCardSeqNo
	 * @param name
	 *            姓名
	 * @param idNo
	 *            证件号
	 * @return
	 */
	public List<SaleOrderRealNameDetail> getSaleOrderRealNameDetailListByCondition(
			PCPSWebInput webInput, BigInteger saleOrderId, String batchNo,
			String cardNo, String startCardSeqNo, String endCardSeqNo,
			String name, String idNo, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return saleOrderRealNameDetailDaoImpl
				.getSaleOrderRealNameDetailListByCondition(saleOrderId,
						batchNo, cardNo, startCardSeqNo, endCardSeqNo, name,
						idNo, page);
	}

	/**
	 * 记录条数
	 * 
	 * @param saleOrderId
	 * @param batchNo
	 * @param cardNo
	 * @param startCardSeqNo
	 * @param endCardSeqNo
	 * @param name
	 * @param idNo
	 * @return
	 */
	public BigInteger getSaleOrderRealNameDetailTotalByCondition(
			BigInteger saleOrderId, String batchNo, String cardNo,
			String startCardSeqNo, String endCardSeqNo, String name, String idNo) {
		return saleOrderRealNameDetailDaoImpl
				.getSaleOrderRealNameDetailTotalByCondition(saleOrderId,
						batchNo, cardNo, startCardSeqNo, endCardSeqNo, name,
						idNo);
	}

	@EJB(mappedName = "salesmanage.impl.SaleOrderPaidDetailDaoImpl")
	private SaleOrderPaidDetailDao saleOrderPaidDetailDaoImpl;

	/**
	 * 根据销售单号查询此销售单已经付款(销售款或手续费)的金额总和
	 * 
	 * @param saleOrderId
	 * @param paidClass
	 * @return
	 */
	public BigInteger getAlreayPaidAmountBySaleOrderId(BigInteger saleOrderId,
			String paidClass) {
		return saleOrderPaidDetailDaoImpl.getAlreayPaidAmountBySaleOrderId(
				saleOrderId, paidClass);
	}

	/**
	 * 根据销售单付款信息主键编号查询销售单付款信息
	 * 
	 * @param saleOrderPaidId
	 *            销售单付款信息
	 * @return 销售单付款信息
	 */
	public SaleOrderPaidDetail getSaleOrderPaidDetailBySaleOrderPaidId(
			BigInteger saleOrderPaidId) {
		return saleOrderPaidDetailDaoImpl
				.getSaleOrderPaidDetailBySaleOrderPaidId(saleOrderPaidId);
	}

	/**
	 * 销售单付款信息
	 * 
	 * @param saleOrderId
	 * @return
	 */
	public List<SaleOrderPaidDetail> getSaleOrderPaidDetailListBySaleOrderId(
			PCPSWebInput webInput, BigInteger saleOrderId) {

		commonDaoImpl.setSysLogPath(webInput);
		return saleOrderPaidDetailDaoImpl
				.getSaleOrderPaidDetailListBySaleOrderId(saleOrderId);
	}

	/**
	 * 销售单付款查询
	 * 
	 * @param saleOrderId
	 * @param paidType
	 * @param startTranTime
	 * @param endTranTime
	 * @param startPaidAmount
	 * @param endPaidAmount
	 * @param page
	 * @return
	 */
	public List<SaleOrderPaidDetail> getSaleOrderPaidDetailListByCondition(
			PCPSWebInput webInput, BigInteger saleOrderId, String paidType,
			String startTranTime, String endTranTime,
			BigInteger startPaidAmount, BigInteger endPaidAmount,
			String paidClass, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return saleOrderPaidDetailDaoImpl
				.getSaleOrderPaidDetailListByCondition(saleOrderId, paidType,
						startTranTime, endTranTime, startPaidAmount,
						endPaidAmount, paidClass, page);
	}

	/**
	 * 销售单付款查询记录数
	 * 
	 * @param saleOrderId
	 * @param paidType
	 * @param startTranTime
	 * @param endTranTime
	 * @param startPaidAmount
	 * @param endPaidAmount
	 * @return
	 */
	public BigInteger getSaleOrderPaidDetailTotalByCondition(
			BigInteger saleOrderId, String paidType, String startTranTime,
			String endTranTime, BigInteger startPaidAmount,
			BigInteger endPaidAmount, String paidClass) {
		return saleOrderPaidDetailDaoImpl
				.getSaleOrderPaidDetailTotalByCondition(saleOrderId, paidType,
						startTranTime, endTranTime, startPaidAmount,
						endPaidAmount, paidClass);
	}

	// 销售单状态迁移明细
	@EJB(mappedName = "salesmanage.impl.SaleOrderActionDetailDaoImpl")
	private SaleOrderActionDetailDao saleOrderActionDetailDaoImpl;

	/**
	 * @param saleOrderId
	 * @param page
	 * @return
	 */
	public List<SaleOrderActionDetail> SaleOrderActionDetailList(
			PCPSWebInput webInput, String saleOrderId, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return saleOrderActionDetailDaoImpl.getSaleOrderActionDetailList(
				saleOrderId, page);
	}

	/**
	 * @param saleOrderId
	 * @return
	 */
	public BigInteger SaleOrderActionDetailTotal(String saleOrderId) {
		return saleOrderActionDetailDaoImpl
				.getSaleOrderActionDetailTotal(saleOrderId);
	}

	// 卡交易下激活单
	@EJB(mappedName = "cardtransactions.impl.SaleTransBusinessImpl")
	private SaleTransBusiness saleTransBusinessImpl;

	/**
	 * 激活销售单
	 * 
	 * @param saleOrderId
	 *            销售单ID
	 * @param operId
	 *            操作员ID
	 */
	public CommonWebResult activateSaleOrder(PCPSWebInput webInput,
			BigInteger saleOrderId, BigInteger operId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			saleTransBusinessImpl.activateSaleOrder(webInput, saleOrderId,
					operId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 撤销激活销售单
	 * 
	 * @param saleOrderId
	 *            销售单ID
	 * @param operId
	 *            操作员ID
	 * @param remark
	 *            撤销激活原因
	 */
	public CommonWebResult cancelActivateSaleOrder(PCPSWebInput webInput,
			BigInteger saleOrderId, BigInteger operId, String remark) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			saleTransBusinessImpl.cancelActivateSaleOrder(webInput,
					saleOrderId, operId, remark);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 冻结已激活销售单
	 * 
	 * @param saleOrderId
	 *            销售单ID
	 * @param operId
	 *            操作员ID
	 * @param remark
	 *            冻结原因
	 */
	public CommonWebResult freezeSaleOrder(PCPSWebInput webInput,
			BigInteger saleOrderId, BigInteger operId, String remark) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			saleTransBusinessImpl.freezeSaleOrder(webInput, saleOrderId,
					operId, remark);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 解冻结已激活销售单
	 * 
	 * @param saleOrderId
	 *            销售单ID
	 * @param operId
	 *            操作员ID
	 * @param remark
	 *            解冻结原因
	 */
	public CommonWebResult unFreezeSaleOrder(PCPSWebInput webInput,
			BigInteger saleOrderId, BigInteger operId, String remark) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			saleTransBusinessImpl.unFreezeSaleOrder(webInput, saleOrderId,
					operId, remark);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	@EJB(mappedName = "capitalaccounts.impl.FundsReportDaoImpl")
	private FundsReportDao fundsReportDaoImpl;

	/**
	 * 获取某发卡商下发卡机构某段时间已审核资金
	 * 
	 * @param webInput
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public List<FundsReportObj> getIssueBranchAuditFunds(PCPSWebInput webInput,
			String startDate, String endDate) {
		return fundsReportDaoImpl.getIssueBranchAuditFunds(webInput, startDate,
				endDate);
	}

	/**
	 * 获取某发卡商下发卡机构某段时间已发放激活额度
	 * 
	 * @param webInput
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public List<FundsReportObj> getIssueBranchSendCredit(PCPSWebInput webInput,
			String startDate, String endDate) {
		return fundsReportDaoImpl.getIssueBranchSendCredit(webInput, startDate,
				endDate);
	}

	/**
	 * 获取某发卡商下发卡机构某段时间手续费情况
	 * 
	 * @param webInput
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public List<FundsReportObj> getIssueBranchFee(PCPSWebInput webInput,
			String startDate, String endDate) {
		return fundsReportDaoImpl.getIssueBranchFee(webInput, startDate,
				endDate);
	}

	@EJB(mappedName = "capitalaccounts.impl.SaleCapitalDetailDaoImpl")
	private SaleCapitalDetailDao SaleCapitalDetailDaoImpl;

	/**
	 * 查询销售机构资金明细列表
	 */
	public List<SaleCapitalDetail> getSaleCapitalDetailList(
			PCPSWebInput webInput, Integer page, Date startTranDate,
			Date endTranDate, BigInteger startAmount, BigInteger endAmount,
			BigInteger ticketId, String saleBranchNo, String tranType) {

		commonDaoImpl.setSysLogPath(webInput);
		return SaleCapitalDetailDaoImpl.getSaleCapitalDetailList(webInput,
				page, startTranDate, endTranDate, startAmount, endAmount,
				ticketId, saleBranchNo, tranType);
	}

	/**
	 * 查询销售机构资金明细总数
	 */
	public BigInteger getSaleCapitalDetailCount(PCPSWebInput webInput,
			Date startTranDate, Date endTranDate, BigInteger startAmount,
			BigInteger endAmount, BigInteger ticketId, String saleBranchNo,
			String tranType) {
		return SaleCapitalDetailDaoImpl.getSaleCapitalDetailCount(webInput,
				startTranDate, endTranDate, startAmount, endAmount, ticketId,
				saleBranchNo, tranType);
	}

	/**
	 * 查询销售机构资金明细列表
	 */
	public List<SaleCapitalDetail> getCashSaleCapitalDetailList(
			PCPSWebInput webInput, Integer page, Date startTranDate,
			Date endTranDate, BigInteger startAmount, BigInteger endAmount,
			BigInteger ticketId, String saleBranchNo, String tranType) {

		commonDaoImpl.setSysLogPath(webInput);
		return SaleCapitalDetailDaoImpl.getCashSaleCapitalDetailList(webInput,
				page, startTranDate, endTranDate, startAmount, endAmount,
				ticketId, saleBranchNo, tranType);
	}

	/**
	 * 查询销售机构资金明细总数
	 */
	public BigInteger getCashSaleCapitalDetailCount(PCPSWebInput webInput,
			Date startTranDate, Date endTranDate, BigInteger startAmount,
			BigInteger endAmount, BigInteger ticketId, String saleBranchNo,
			String tranType) {
		return SaleCapitalDetailDaoImpl.getCashSaleCapitalDetailCount(webInput,
				startTranDate, endTranDate, startAmount, endAmount, ticketId,
				saleBranchNo, tranType);
	}

	// 充值单
	@EJB(mappedName = "salesmanage.impl.DepositOrderBusinessImpl")
	private DepositOrderBusiness depositOrderBusinessImpl;
	@EJB(mappedName = "salesmanage.impl.DepositOrderDaoImpl")
	private DepositOrderDao depositOrderDaoImpl;

	/**
	 * 根据充值单编号主键查询充值单
	 * 
	 * @param DepositOrderId
	 *            充值单编号
	 * @return 充值单
	 */
	public DepositOrder getDepositOrderByDepositOrderId(
			BigInteger depositOrderId) {
		return depositOrderDaoImpl
				.getDepositOrderByDepositOrderId(depositOrderId);
	}

	public DepositOrder getDepositOrderBySaleOrderSeqNo(String saleOrderSeqNo) {
		return depositOrderDaoImpl
				.getDepositOrderBySaleOrderSeqNo(saleOrderSeqNo);
	}

	/**
	 * 批量充值创建
	 */
	public SaleOrderResult createDepositOrder(PCPSWebInput webInput,
			DepositOrder depositOrder, List<DepositOrderDetail> cardDetailList,
			List<DepositOrderSalesDetail> depSalesDetail,
			List<DepositOrderPaidDetail> depPaidDetail) {

		commonDaoImpl.setSysLogPath(webInput);
		DepositOrder so = null;
		try {
			so = depositOrderBusinessImpl
					.createDepositOrder(webInput, depositOrder, cardDetailList,
							depSalesDetail, depPaidDetail);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new SaleOrderResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new SaleOrderResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		SaleOrderResult sor = new SaleOrderResult();
		sor.setDepositOrder(so);
		return sor;
	}

	/**
	 * 充值单打包上送
	 * 
	 * @param webInput
	 * @param depositOrderIds
	 * @param commitVoucherNo
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult updateDepositOrderCommitVoucherNo(
			PCPSWebInput webInput, BigInteger[] depositOrderIds,
			BigInteger bankAccDetailId) {
		try {
			commonDaoImpl.setSysLogPath(webInput);
			depositOrderBusinessImpl.updateDepositOrderCommitVoucherNo(
					webInput, depositOrderIds, bankAccDetailId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 充值单资金审核
	 * 
	 * @param webInput
	 * @param depositOrderIds
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult authDepositOrderMoney(PCPSWebInput webInput,
			BigInteger[] depositOrderIds) {
		try {
			commonDaoImpl.setSysLogPath(webInput);
			depositOrderBusinessImpl.authDepositOrderMoney(webInput,
					depositOrderIds);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 单个充值单资金审核
	public CommonWebResult authOneDepositOrderMoney(PCPSWebInput webInput,
			BigInteger b) {
		try {
			commonDaoImpl.setSysLogPath(webInput);
			depositOrderBusinessImpl.authOneDepositOrderMoney(webInput, b);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 判断充值单是否含有现金付款
	 * 
	 * @param depositOrderIds
	 * @return
	 */
	public boolean checkCashDepositOrder(BigInteger[] depositOrderIds) {
		return depositOrderBusinessImpl.checkCashDepositOrder(depositOrderIds);
	}

	/**
	 * 撤销充值单
	 * 
	 * @param webInput
	 * @param depositOrder
	 * @return
	 */
	public SaleOrderResult cancelDepositOrder(PCPSWebInput webInput,
			DepositOrder depositOrder) {
		commonDaoImpl.setSysLogPath(webInput);
		DepositOrder so = null;
		try {
			so = depositOrderBusinessImpl.cancelDepositOrder(webInput,
					depositOrder);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new SaleOrderResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new SaleOrderResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		SaleOrderResult sor = new SaleOrderResult();
		sor.setDepositOrder(so);
		return sor;
	}

	/**
	 * 打印充值单时凭证出库
	 * 
	 * @param webInput
	 * @param saleOrderId
	 * @param voucherId
	 * @param voucherNo
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult updateDepositOrderVoucherNo(PCPSWebInput webInput,
			BigInteger depositOrderId, String voucherNo) {
		try {

			commonDaoImpl.setSysLogPath(webInput);
			depositOrderBusinessImpl.updateDepositOrderVoucherNo(webInput,
					depositOrderId, voucherNo);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 组合查询充值单
	 * 
	 * @param saleBranchNo
	 *            销售机构No
	 * @param depositType
	 *            充值单类型
	 * @param startSaleAmount
	 *            起始充值单金额
	 * @param endSaleAmount
	 *            终止充值单金额
	 * @param startTime
	 *            起始销售时间
	 * @param endTime
	 *            终止销售时间
	 * @param orderStatus
	 *            充值单状态
	 * @param btnStatus
	 *            前台传入那种查询状态
	 * @param page
	 *            分页页码
	 * @return 充值单列表
	 */
	public List<DepositOrder> getDepositOrderListByCondition(
			PCPSWebInput webInput, String depositOrderId, String saleBranchNo,
			String depositType, BigInteger startSaleAmount,
			BigInteger endSaleAmount, String startTime, String endTime,
			String orderStatus, String btnStatus, String feeType, Integer page) {
		commonDaoImpl.setSysLogPath(webInput);
		return depositOrderDaoImpl.getDepositOrderListByCondition(webInput,
				depositOrderId, saleBranchNo, depositType, startSaleAmount,
				endSaleAmount, startTime, endTime, orderStatus, btnStatus,
				feeType, page);
	}

	/**
	 * 组合查询充值单Sum
	 * 
	 * @param saleBranchNo
	 *            销售机构No
	 * @param depositType
	 *            充值单类型
	 * @param startSaleAmount
	 *            起始充值单金额
	 * @param endSaleAmount
	 *            终止充值单金额
	 * @param startTime
	 *            起始销售时间
	 * @param endTime
	 *            终止销售时间
	 * @param orderStatus
	 *            充值单状态
	 * @param btnStatus
	 *            前台传入那种查询状态
	 * @param page
	 *            分页页码
	 * @return 充值单列表
	 */
	public Object[] getDepositOrderListByConditionSum(PCPSWebInput webInput,
			String depositOrderId, String saleBranchNo, String depositType,
			BigInteger startSaleAmount, BigInteger endSaleAmount,
			String startTime, String endTime, String orderStatus,
			String btnStatus, String feeType) {

		commonDaoImpl.setSysLogPath(webInput);
		return depositOrderDaoImpl.getDepositOrderListByConditionSum(webInput,
				depositOrderId, saleBranchNo, depositType, startSaleAmount,
				endSaleAmount, startTime, endTime, orderStatus, btnStatus,
				feeType);
	}

	/**
	 * 组合查询充值单
	 * 
	 * @param saleBranchNo
	 *            销售机构No
	 * @param depositType
	 *            充值单类型
	 * @param startSaleAmount
	 *            起始充值单金额
	 * @param endSaleAmount
	 *            终止充值单金额
	 * @param startTime
	 *            起始销售时间
	 * @param endTime
	 *            终止销售时间
	 * @param orderStatus
	 *            充值单状态
	 * @param btnStatus
	 *            前台传入那种查询状态
	 * @return 充值单记录数
	 */
	public BigInteger getDepositOrderTotalByCondition(PCPSWebInput webInput,
			String depositOrderId, String saleBranchNo, String depositType,
			BigInteger startSaleAmount, BigInteger endSaleAmount,
			String startTime, String endTime, String orderStatus,
			String btnStatus, String feeType) {
		commonDaoImpl.setSysLogPath(webInput);
		return depositOrderDaoImpl.getDepositOrderTotalByCondition(webInput,
				depositOrderId, saleBranchNo, depositType, startSaleAmount,
				endSaleAmount, startTime, endTime, orderStatus, btnStatus,
				feeType);
	}

	// 充值单状态迁移明细
	@EJB(mappedName = "salesmanage.impl.DepositOrderActionDetailDaoImpl")
	private DepositOrderActionDetailDao depOrderAcDeDaoImpl;

	/**
	 * 分页查询充值单状态迁移明细
	 * 
	 * @param depositOrderId
	 * @param page
	 * @return
	 */
	public List<DepositOrderActionDetail> getDepositOrderActionDetailList(
			PCPSWebInput webInput, BigInteger depositOrderId, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return depOrderAcDeDaoImpl.getDepositOrderActionDetailList(
				depositOrderId, page);
	}

	/**
	 * 查询充值单状态迁移明细记录数
	 * 
	 * @param depositOrderId
	 *            充值单编号
	 * @return 记录数
	 */
	public BigInteger getDepositOrderActionDetailTotal(BigInteger depositOrderId) {
		return depOrderAcDeDaoImpl
				.getDepositOrderActionDetailTotal(depositOrderId);
	}

	/**
	 * 卡-4.1 充值统计表
	 * 
	 * @param webInput
	 * @param saleBranchNo
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	public List<Object[]> getCardBatchDepositReportByCondition(
			PCPSWebInput webInput, String branchNo, String startTime,
			String endTime) {
		return depositOrderDaoImpl.getCardBatchDepositReportByCondition(
				webInput, branchNo, startTime, endTime);
	}

	/**
	 * 卡-4.2 充值明细表
	 * 
	 * @param webInput
	 * @param saleBranchNo
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	public List<Object[]> getCardBatchDepositDetailReportByCondition(
			PCPSWebInput webInput, String saleBranchNo, String startTime,
			String endTime) {
		return depositOrderDaoImpl.getCardBatchDepositDetailReportByCondition(
				webInput, saleBranchNo, startTime, endTime);
	}

	// 充值单充值卡明细
	@EJB(mappedName = "salesmanage.impl.DepositOrderDetailDaoImpl")
	private DepositOrderDetailDao depositOrderDetailDaoImpl;
	@EJB(mappedName = "salesmanage.impl.DepositOrderDetailBusinessImpl")
	private DepositOrderDetailBusiness depositOrderDetailBusinessImpl;

	/**
	 * 卡充值单明细报表:根据充值单id获取充值单明细
	 * 
	 * @param orderId
	 * @return
	 */
	public List<Object[]> getDepositOrderCardDetailReportByOrderId(
			BigInteger orderId) {
		return depositOrderDetailDaoImpl
				.getDepositOrderCardDetailReportByOrderId(orderId);
	}

	/**
	 * 分页查询充值单卡明细
	 * 
	 * @param webInput
	 * @param depositOrderId
	 * @param page
	 * @return
	 */
	public List<DepositOrderDetail> getDepositOrderDetailListByCondition(
			PCPSWebInput webInput, BigInteger depositOrderId, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return depositOrderDetailDaoImpl.getDepositOrderDetailListByCondition(
				depositOrderId, page);
	}

	/**
	 * 查询充值单卡明细记录数
	 * 
	 * @param webInput
	 * @param depositOrderId
	 * @return
	 */
	public BigInteger getDepositOrderDetailTotalByCondition(
			BigInteger depositOrderId) {
		return depositOrderDetailDaoImpl
				.getDepositOrderDetailTotalByCondition(depositOrderId);
	}

	/**
	 * 根据充值单编号查询充值单卡明细
	 * 
	 * @param depositOrderId
	 * @return
	 */
	public List<DepositOrderDetail> getDepositOrderDetailListByDepositOrderId(
			PCPSWebInput webInput, BigInteger depositOrderId) {
		return depositOrderDetailDaoImpl
				.getDepositOrderDetailListByDepositOrderId(depositOrderId);
	}

	/**
	 * 根据购卡人类型名称查询批量充值卡列表 下载充值客户卡列表
	 * 
	 * @param webInput
	 * @param serchType
	 *            0 - 充值单 1 - 销售单 未充值过数据选择 查询充值单已充值列表还是销售单已购卡列表
	 * @param buyerType
	 *            购卡人类型
	 * @param name
	 *            名称
	 * @return
	 */
	public List<DepositOrderDetail> getDepositOrderCardList(
			PCPSWebInput webInput, String serchType, String buyerType,
			String name) {

		commonDaoImpl.setSysLogPath(webInput);
		return depositOrderDetailDaoImpl.getDepositOrderCardList(webInput,
				serchType, buyerType, name);
	}

	/**
	 * 添加充值单卡充值明细
	 * 
	 * @param webInput
	 * @param depositOrderId
	 * @param depOrdDetailList
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult insertDepositOrderDetailInfo(PCPSWebInput webInput,
			BigInteger depositOrderId, List<DepositOrderDetail> depOrdDetailList) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			depositOrderDetailBusinessImpl.insertDepositOrderDetailInfo(
					webInput, depositOrderId, depOrdDetailList);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 删除充值单卡充值明细
	 * 
	 * @param webInput
	 * @param depositOrderId
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult deleteDepositOrderDetailInfo(PCPSWebInput webInput,
			BigInteger depositOrderId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			depositOrderDetailBusinessImpl.deleteDepositOrderDetailInfo(
					webInput, depositOrderId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 充值单付款信息
	@EJB(mappedName = "salesmanage.impl.DepositOrderPaidDetailBusinessImpl")
	private DepositOrderPaidDetailBusiness depositOrderPaidDetailBusinessImpl;
	@EJB(mappedName = "salesmanage.impl.DepositOrderPaidDetailDaoImpl")
	private DepositOrderPaidDetailDao depositOrderPaidDetailDaoImpl;

	/**
	 * 根据充值单付款信息主键编号查询充值单付款信息
	 * 
	 * @param depositOrderPaidId
	 *            充值单付款信息
	 * @return 充值单付款信息
	 */
	public DepositOrderPaidDetail getDepositOrderPaidDetailByPaidId(
			BigInteger depositOrderPaidId) {
		return depositOrderPaidDetailDaoImpl
				.getDepositOrderPaidDetailByPaidId(depositOrderPaidId);
	}

	/**
	 * 分页查询充值单付款
	 * 
	 * @param depositOrderId
	 *            充值单编号
	 * @param paidType
	 *            支付类型
	 * @param startPaidAmount
	 *            起始支付金额
	 * @param endPaidAmount
	 *            终止支付金额
	 * @param page
	 *            页码
	 * @return 充值单付款信息列表
	 */
	public List<DepositOrderPaidDetail> getDepositOrderPaidDetailListByCondition(
			PCPSWebInput webInput, BigInteger depositOrderId, String paidType,
			BigInteger startPaidAmount, BigInteger endPaidAmount,
			String paidClass, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return depositOrderPaidDetailDaoImpl
				.getDepositOrderPaidDetailListByCondition(depositOrderId,
						paidType, startPaidAmount, endPaidAmount, paidClass,
						page);
	}

	/**
	 * 充值单付款查询记录数
	 * 
	 * @param depositOrderId
	 *            充值单编号
	 * @param paidType
	 *            支付类型
	 * @param startPaidAmount
	 *            起始支付金额
	 * @param endPaidAmount
	 *            终止支付金额
	 * @return 记录数
	 */
	public BigInteger getDepositOrderPaidDetailTotalByCondition(
			PCPSWebInput webInput, BigInteger depositOrderId, String paidType,
			BigInteger startPaidAmount, BigInteger endPaidAmount,
			String paidClass) {

		commonDaoImpl.setSysLogPath(webInput);
		return depositOrderPaidDetailDaoImpl
				.getDepositOrderPaidDetailTotalByCondition(depositOrderId,
						paidType, startPaidAmount, endPaidAmount, paidClass);
	}

	/**
	 * 充值单付款
	 * 
	 * @param dopd
	 */
	public CommonWebResult insertDepositOrderPaidDetail(PCPSWebInput webInput,
			DepositOrderPaidDetail dopd) {

		commonDaoImpl.setSysLogPath(webInput);
		BigInteger res = BigInteger.ZERO;
		try {
			res = depositOrderPaidDetailBusinessImpl
					.insertDepositOrderPaidDetail(webInput, dopd);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		CommonWebResult cwr = new CommonWebResult();
		cwr.setResult(res.toString());
		return new CommonWebResult();
	}

	/**
	 * 充值单付款撤销
	 * 
	 * @param dopd
	 */
	public CommonWebResult insertDepositOrderPaidDetailCancel(
			PCPSWebInput webInput, BigInteger depositOrderPaidId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			depositOrderPaidDetailBusinessImpl
					.insertDepositOrderPaidDetailCancel(webInput,
							depositOrderPaidId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 充值单销售员
	@EJB(mappedName = "salesmanage.impl.DepositOrderSalesDetailBusinessImpl")
	private DepositOrderSalesDetailBusiness depOrderBusinessImpl;
	@EJB(mappedName = "salesmanage.impl.DepositOrderSalesDetailDaoImpl")
	private DepositOrderSalesDetailDao depOrderDaoImpl;

	/**
	 * 查询充值单下销售员明细列表
	 * 
	 * @param depositOrderId
	 *            充值单编号
	 * @param page
	 *            页码
	 * @return 销售员明细列表列表
	 */
	public List<DepositOrderSalesDetail> getDepositOrderSalesDetailList(
			PCPSWebInput webInput, BigInteger depositOrderId, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return depOrderDaoImpl.getDepositOrderSalesDetailList(depositOrderId,
				page);
	}

	/**
	 * 查询单个充值单下销售员记录数
	 * 
	 * @param depositOrderId
	 *            充值单编号
	 * @return 记录数
	 */
	public BigInteger getDepositOrderSalesDetailTotal(BigInteger depositOrderId) {
		return depOrderDaoImpl.getDepositOrderSalesDetailTotal(depositOrderId);
	}

	/**
	 * 新增充值单销售员明细
	 * 
	 * @param dosd
	 *            充值单销售员明细
	 */
	public CommonWebResult insertDepositOrderSalesDetailInfo(
			PCPSWebInput webInput, DepositOrderSalesDetail dosd) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			depOrderBusinessImpl.insertDepositOrderSalesDetailInfo(webInput,
					dosd);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 删除充值单销售员明细
	 * 
	 * @param dosd
	 *            充值单销售员明细
	 */
	public CommonWebResult deleteDepositOrderSalesDetailInfo(
			PCPSWebInput webInput, DepositOrderSalesDetail dosd) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			depOrderBusinessImpl.deleteDepositOrderSalesDetailInfo(webInput,
					dosd);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 赎回单
	@EJB(mappedName = "salesmanage.impl.RedempOrderDaoImpl")
	private RedempOrderDao redempOrderDaoImpl;
	@EJB(mappedName = "salesmanage.impl.RedempOrderBusinessImpl")
	private RedempOrderBusiness redempOrderBusinessImpl;

	/**
	 * 根据id获取赎回单对象
	 * 
	 * @param redempOrderId
	 * @return
	 */
	public RedempOrder getRedempOrderByRedempOrderId(BigInteger redempOrderId) {
		return redempOrderDaoImpl.getRedempOrderByRedempOrderId(redempOrderId);
	}

	/**
	 * 根据赎回单编号查询
	 * 
	 * @param redempOrderSeqNo
	 * @return
	 */
	public RedempOrder getRedempOrderByredempOrderSeqNo(String redempOrderSeqNo) {
		return redempOrderDaoImpl
				.getRedempOrderByredempOrderSeqNo(redempOrderSeqNo);
	}

	/**
	 * 查询赎回单分页列表
	 * 
	 * @param webInput
	 * @param saleBranchNo
	 * @param startTime
	 * @param endTime
	 * @param orderStatus
	 * @param btnStatus
	 * @param page
	 * @return
	 */
	public List<RedempOrder> getRedempOrderListByCondition(
			PCPSWebInput webInput, String redempOrderId, String saleBranchNo,
			String startTime, String endTime, String orderStatus,
			String btnStatus, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return redempOrderDaoImpl.getRedempOrderListByCondition(webInput,
				redempOrderId, saleBranchNo, startTime, endTime, orderStatus,
				btnStatus, page);
	}

	/**
	 * 查询赎回单分页列表Sum
	 * 
	 * @param webInput
	 * @param saleBranchNo
	 * @param startTime
	 * @param endTime
	 * @param orderStatus
	 * @param btnStatus
	 * @param page
	 * @return
	 */
	public Object[] getRedempOrderListByConditionSum(PCPSWebInput webInput,
			String redempOrderId, String saleBranchNo, String startTime,
			String endTime, String orderStatus, String btnStatus) {

		commonDaoImpl.setSysLogPath(webInput);
		return redempOrderDaoImpl.getRedempOrderListByConditionSum(webInput,
				redempOrderId, saleBranchNo, startTime, endTime, orderStatus,
				btnStatus);
	}

	/**
	 * 查询赎回单记录数
	 * 
	 * @param webInput
	 * @param saleBranchNo
	 * @param startTime
	 * @param endTime
	 * @param orderStatus
	 * @param btnStatus
	 * @return
	 */
	public BigInteger getRedempOrderTotalByCondition(PCPSWebInput webInput,
			String redempOrderId, String saleBranchNo, String startTime,
			String endTime, String orderStatus, String btnStatus) {
		return redempOrderDaoImpl.getRedempOrderTotalByCondition(webInput,
				redempOrderId, saleBranchNo, startTime, endTime, orderStatus,
				btnStatus);
	}

	/**
	 * 创建赎回单
	 * 
	 * @param webInput
	 * @param redempOrder
	 * @param redOrderList
	 * @return
	 * @throws PCPSApplicationException
	 */
	public SaleOrderResult createRedempOrder(PCPSWebInput webInput,
			RedempOrder redempOrder, List<RedempOrderDetail> redOrderList) {

		commonDaoImpl.setSysLogPath(webInput);
		RedempOrder so = null;
		try {
			so = redempOrderBusinessImpl.createRedempOrder(webInput,
					redempOrder, redOrderList);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new SaleOrderResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new SaleOrderResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		SaleOrderResult sor = new SaleOrderResult();
		sor.setRedempOrder(so);
		return sor;
	}

	/**
	 * 打印赎回单时凭证出库
	 * 
	 * @param webInput
	 * @param saleOrderId
	 * @param voucherId
	 * @param voucherNo
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult updateRedempOrderVoucherNo(PCPSWebInput webInput,
			BigInteger redempOrderId, String voucherNo) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			redempOrderBusinessImpl.updateRedempOrderVoucherNo(webInput,
					redempOrderId, voucherNo);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 赎回单 付款记账
	 * 
	 * @param webInput
	 * @param redempOrder
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult updateAccountRedempOrder(PCPSWebInput webInput,
			RedempOrder redempOrder) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			redempOrderBusinessImpl.updateAccountRedempOrder(webInput,
					redempOrder);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 赎回单 终审
	 * 
	 * @param webInput
	 * @param redempOrder
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult secondAudtRedempOrder(PCPSWebInput webInput,
			RedempOrder redempOrder) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			redempOrderBusinessImpl
					.secondAudtRedempOrder(webInput, redempOrder);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 赎回单 取消
	 * 
	 * @param webInput
	 * @param redempOrder
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult cancelRedempOrder(PCPSWebInput webInput,
			RedempOrder redempOrder) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			redempOrderBusinessImpl.cancelRedempOrder(webInput, redempOrder);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 赎回单明细
	@EJB(mappedName = "salesmanage.impl.RedempOrderDetailDaoImpl")
	private RedempOrderDetailDao redempOrderDetailDaoImpl;
	@EJB(mappedName = "salesmanage.impl.RedempOrderDetailBusinessImpl")
	private RedempOrderDetailBusiness redempOrderDetailBusinessImpl;

	/**
	 * 根据赎回单编号查询赎回单明细分页列表
	 * 
	 * @param redempOrderId
	 * @param page
	 * @return
	 */
	public List<RedempOrderDetail> getRedempOrderDetailByCondition(
			PCPSWebInput webInput, BigInteger redempOrderId, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return redempOrderDetailDaoImpl.getRedempOrderDetailByCondition(
				redempOrderId, page);
	}

	/**
	 * 根据赎回单编号查询赎回单明细记录数
	 * 
	 * @param redempOrderId
	 * @return
	 */
	public BigInteger getRedempOrderDetailTotalByCondition(
			BigInteger redempOrderId) {
		return redempOrderDetailDaoImpl
				.getRedempOrderDetailTotalByCondition(redempOrderId);
	}

	public List<RedempOrderDetail> getRedempOrderDetailListByRedempOrderId(
			PCPSWebInput webInput, BigInteger redempOrderId) {

		commonDaoImpl.setSysLogPath(webInput);
		return redempOrderDetailDaoImpl
				.getRedempOrderDetailListByRedempOrderId(redempOrderId);
	}

	/**
	 * 新增赎回单明细
	 * 
	 * @param rod
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult insertRedempOrderDetailInfo(PCPSWebInput webInput,
			RedempOrderDetail rod) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			redempOrderDetailBusinessImpl.insertRedempOrderDetailInfo(webInput,
					rod);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 删除赎回单明细
	 * 
	 * @param rod
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult deleteRedempOrderDetailInfo(PCPSWebInput webInput,
			RedempOrderDetail rod) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			redempOrderDetailBusinessImpl.deleteRedempOrderDetailInfo(webInput,
					rod);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 赎回单状态迁移明细
	@EJB(mappedName = "salesmanage.impl.RedempOrderActionDetailDaoImpl")
	private RedempOrderActionDetailDao redempOrderActionDetailDaoImpl;

	/**
	 * 分页查询赎回单状态迁移明细
	 * 
	 * @param redempOrderId
	 *            赎回单编号
	 * @param page
	 * @return
	 */
	public List<RedempOrderActionDetail> getRedempOrderActionDetailList(
			PCPSWebInput webInput, BigInteger redempOrderId, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return redempOrderActionDetailDaoImpl.getRedempOrderActionDetailList(
				redempOrderId, page);
	}

	/**
	 * 查询赎回单状态迁移明细记录数
	 * 
	 * @param redempOrderId
	 *            赎回单编号
	 * @return 记录数
	 */
	public BigInteger getRedempOrderActionDetailTotal(BigInteger redempOrderId) {
		return redempOrderActionDetailDaoImpl
				.getRedempOrderActionDetailTotal(redempOrderId);
	}

	/**
	 * 销售管理salesmanage模块===========================end
	 */
	/**
	 * 制卡管理cardmanagement模块===========================start
	 */
	@EJB(mappedName = "cardmanagement.impl.CardClassicDaoImpl")
	private CardClassicDao CardClassicDaoImpl;

	@EJB(mappedName = "cardmanagement.impl.InitialInStockOrderDaoImpl")
	private InitialInStockOrderDao InitialInStockOrderDaoImpl;

	@EJB(mappedName = "cardmanagement.impl.CardStockDaoImpl")
	private CardStockDao CardStockDaoImpl;

	/**
	 * 获取领卡单剩余的卡数量
	 * 
	 * @param salesGetCardOrderId
	 * @return
	 */
	public List<Object[]> getCardStockCountBySalesGetCardOrderId(
			BigInteger salesGetCardOrderId, int orderItemSeqNo) {
		return CardStockDaoImpl.getCardStockCountBySalesGetCardOrderId(
				salesGetCardOrderId, orderItemSeqNo);
	}

	/**
	 * 查询某销售机构序号段卡库存
	 * 
	 * @param startCardSeqNo
	 *            起始序列号
	 * @param endCardSeqNo
	 *            结束序列号
	 * @param status
	 *            状态
	 * @param SaleBranchNo
	 *            销售机构号
	 * @return CardStock 对象集合
	 */
	public List<CardStock> getCardStockListBySaleBranchNoAndStatusAndCredseqno(
			PCPSWebInput webInput, String startCardSeqNo, String endCardSeqNo,
			String status, String SaleBranchNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return CardStockDaoImpl
				.getCardStockListBySaleBranchNoAndStatusAndCredseqno(
						startCardSeqNo, endCardSeqNo, status, SaleBranchNo);
	}

	/**
	 * 查询某销售机构序号段卡库存
	 * 
	 * @param webInput
	 * @param startCardSeqNo
	 * @param endCardSeqNo
	 * @param SaleBranchNo
	 * @return
	 */
	public List<CardStock> getCardStockListBySaleBranchNoAndCardSeqNo(
			PCPSWebInput webInput, String startCardSeqNo, String endCardSeqNo,
			String SaleBranchNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return CardStockDaoImpl.getCardStockListBySaleBranchNoAndCardSeqNo(
				startCardSeqNo, endCardSeqNo, SaleBranchNo);
	}

	/**
	 * 根据发卡商，是否充值，卡介质，是否实名综合查询列表
	 * 
	 * @param IssueCompanyNo
	 *            发卡商编号
	 * @param allowdeposit
	 *            是否充值
	 * @param mediatype
	 *            卡介质
	 * @param isrealname
	 *            是否实名
	 * @param page
	 *            页数
	 * @return 卡种类列表
	 */
	public List<CardClassic> getCardClassicListByCondition(PCPSWebInput input,
			String allowdeposit, String isrealname, Integer page) {

		commonDaoImpl.setSysLogPath(input);
		return CardClassicDaoImpl.getCardClassicListByCondition(input,
				allowdeposit, isrealname, page);
	}

	/**
	 * 根据发卡商，是否充值，卡介质，是否实名综合查询记录条数
	 * 
	 * @param IssueCompanyNo
	 *            发卡商编号
	 * @param allowdeposit
	 *            是否充值
	 * @param mediatype
	 *            卡介质
	 * @param isrealname
	 *            是否实名
	 * @param page
	 *            页数
	 * @return 卡种类列表总数
	 */
	public Integer getCardClassicCountByIssueCompanyNo(PCPSWebInput input,
			String allowdeposit, String isrealname) {

		commonDaoImpl.setSysLogPath(input);
		return CardClassicDaoImpl.getCardClassicCountByIssueCompanyNo(input,
				allowdeposit, isrealname);
	}

	/**
	 * 根据机构号，状态查询库存
	 * 
	 * @param BranchNo既可以是销售也可以是制卡
	 * @param CardClassicId
	 * @param CardParValueId
	 * @param status
	 * @return
	 */
	public List<CardStockClassicInfo> getCardStockListBySysBranchNo_Cardclassic_Parvalue_Status(
			PCPSWebInput webInput, String branchno, String status) {

		commonDaoImpl.setSysLogPath(webInput);
		return CardStockDaoImpl
				.getCardStockListBySysBranchNo_Cardclassic_Parvalue_Status(
						branchno, status);
	}

	/**
	 * 卡库存综合查询
	 */
	public List<BranchCardStock> getBranchCardStock(PCPSWebInput webInput,
			String branchno, String batchno, String status,
			BigInteger cardFaceId, Integer page) {
		return CardStockDaoImpl.getBranchCardStock(webInput, branchno, batchno,
				status, cardFaceId, page);
	}

	/**
	 * 卡库存综合查询记录条数
	 */
	public Integer getBranchCardStockCount(PCPSWebInput webInput,
			String branchno, String batchno, String status,
			BigInteger cardFaceId) {
		return CardStockDaoImpl.getBranchCardStockCount(webInput, branchno,
				batchno, status, cardFaceId);
	}

	/**
	 * 卡库存详细信息查询，输入批次号，机构号，返回具体卡号段信息
	 * 
	 * @param 批次号
	 * @param 机构号
	 * @return 卡序号段集合
	 */
	public List<CardStock> getCardStockDetail(PCPSWebInput webInput,
			String batchno, String branchno, String status, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return CardStockDaoImpl.getCardStockDetail(batchno, branchno, status,
				page);
	}

	/**
	 * 卡库存详细信息查询，输入批次号，机构号，返回具体卡号段信息
	 * 
	 * @param 批次号
	 * @param 机构号
	 * @return 卡序号段集合总数
	 */
	public BigInteger getCardStockDetailTotal(String batchno, String branchno,
			String status) {
		return CardStockDaoImpl.getCardStockDetailTotal(batchno, branchno,
				status);
	}

	public List<Object[]> getCardStockReportOne(PCPSWebInput webInput,
			String branchNo) {
		return CardStockDaoImpl.getCardStockReportOne(webInput, branchNo);
	}

	public List<Object[]> getCardStockReportTwo(String branchNo) {
		return CardStockDaoImpl.getCardStockReportTwo(branchNo);
	}

	public List<Object[]> getCardStockReportThird(String batchno,
			String branchno) {
		return CardStockDaoImpl.getCardStockReportThird(batchno, branchno);
	}

	/**
	 * 根据主键查询入库单
	 * 
	 * @param InitialInStockOrderId
	 * @return InitialInStockOrder
	 */
	public InitialInStockOrder getInitialInStockOrderByCardInitialInStockOrderId(
			BigInteger InitialInStockOrderId) {
		return InitialInStockOrderDaoImpl
				.getInitialInStockOrderByCardInitialInStockOrderId(InitialInStockOrderId);
	}

	/**
	 * 根据卡种类Id返回对应实体
	 * 
	 * @param id
	 * @return
	 */
	public CardClassic getCardClassicByCardClassicId(BigInteger CardClassicId) {
		return CardClassicDaoImpl.getCardClassicByCardClassicId(CardClassicId);
	}

	/**
	 * @新增卡种类
	 * @param SaleCompany
	 */
	public CommonWebResult insertCardClassic(PCPSWebInput webInput,
			CardClassic CardClassic) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			CardClassicDaoImpl.insertCardClassic(CardClassic);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return new CommonWebResult();
	}

	// 卡图样
	@EJB(mappedName = "cardmanagement.impl.CardFaceBusinessImpl")
	private CardFaceBusiness cardFaceBusinessImpl;
	@EJB(mappedName = "cardmanagement.impl.CardFaceDaoImpl")
	private CardFaceDao cardFaceDaoImpl;

	/**
	 * 新增卡面图样
	 * 
	 * @param input
	 * @param cardFace @
	 */
	public CommonWebResult insertCardFace(PCPSWebInput input, CardFace cardFace) {

		commonDaoImpl.setSysLogPath(input);
		try {
			cardFaceBusinessImpl.insertCardFace(input, cardFace);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改卡面图样
	 * 
	 * @param input
	 * @param cardFace @
	 */
	public CommonWebResult updateCardFace(PCPSWebInput input, CardFace cardFace) {

		commonDaoImpl.setSysLogPath(input);
		try {
			cardFaceBusinessImpl.updateCardFace(input, cardFace);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据主键查询
	 * 
	 * @param cardFaceId
	 * @return
	 */
	public CardFace getCardFaceByCardFaceId(BigInteger cardFaceId) {
		return cardFaceDaoImpl.getCardFaceByCardFaceId(cardFaceId);
	}

	/**
	 * 根据卡序号获取卡面名称信息
	 * 
	 * @param input
	 * @param cardSeqNo
	 * @return
	 */
	public CardFace getCardFaceByCardSeqNo(PCPSWebInput input, String cardSeqNo) {
		return cardFaceDaoImpl.getCardFaceByCardSeqNo(input, cardSeqNo);
	}

	/**
	 * 下拉
	 * 
	 * @param input
	 * @return
	 */
	public List<CardFace> getCardFaceDropDownList(PCPSWebInput input) {

		commonDaoImpl.setSysLogPath(input);
		return cardFaceDaoImpl.getCardFaceDropDownList(input);
	}

	/**
	 * 分页查询列表
	 * 
	 * @param input
	 * @param cardFaceName
	 * @param page
	 * @return
	 */
	public List<CardFace> getCardFaceListByCondition(PCPSWebInput input,
			String cardFaceName, Integer page) {

		commonDaoImpl.setSysLogPath(input);
		return cardFaceDaoImpl.getCardFaceListByCondition(input, cardFaceName,
				page);
	}

	/**
	 * 总记录数
	 * 
	 * @param input
	 * @param cardFaceName
	 * @return
	 */
	public BigInteger getCardFaceTotalByCondition(PCPSWebInput input,
			String cardFaceName) {
		return cardFaceDaoImpl.getCardFaceTotalByCondition(input, cardFaceName);
	}

	// 代发卡类
	@EJB(mappedName = "cardmanagement.impl.ProxyIssueDaoImpl")
	private ProxyIssueDao proxyIssueDaoImpl;

	/**
	 * 根据主键查询
	 * 
	 * @param cardFaceId
	 * @return
	 */
	public ProxyIssue getProxyIssueByProxyIssueBin(String proxyIssueBin) {
		return proxyIssueDaoImpl.getProxyIssueByProxyIssueBin(proxyIssueBin);
	}

	/**
	 * 下拉
	 * 
	 * @param input
	 * @return
	 */
	public List<ProxyIssue> getProxyIssueDropDownList(PCPSWebInput input) {

		commonDaoImpl.setSysLogPath(input);
		return proxyIssueDaoImpl.getProxyIssueDropDownList(input);
	}

	/**
	 * 分页查询列表
	 * 
	 * @param input
	 * @param cardFaceName
	 * @param page
	 * @return
	 */
	public List<ProxyIssue> getProxyIssueListByCondition(PCPSWebInput input,
			Integer page) {

		commonDaoImpl.setSysLogPath(input);
		return proxyIssueDaoImpl.getProxyIssueListByCondition(input, page);
	}

	/**
	 * 总记录数
	 * 
	 * @param input
	 * @param cardFaceName
	 * @return
	 */
	public BigInteger getProxyIssueTotalByCondition(PCPSWebInput input) {
		return proxyIssueDaoImpl.getProxyIssueTotalByCondition(input);
	}

	/**
	 * 新增代发卡
	 * 
	 * @param input
	 * @param proxyIssue @
	 */
	public CommonWebResult insertProxyIssue(PCPSWebInput input,
			ProxyIssue proxyIssue) {

		commonDaoImpl.setSysLogPath(input);
		try {
			proxyIssueDaoImpl.insertProxyIssue(input, proxyIssue);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改代发卡
	 * 
	 * @param input
	 * @param proxyIssue @
	 */
	public CommonWebResult updateProxyIssue(PCPSWebInput input,
			ProxyIssue proxyIssue) {

		commonDaoImpl.setSysLogPath(input);
		try {
			proxyIssueDaoImpl.updateProxyIssue(input, proxyIssue);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 删除代发卡
	 * 
	 * @param input
	 * @param proxyIssue @
	 */
	public CommonWebResult deleteProxyIssue(PCPSWebInput input,
			String proxyIssue) {

		commonDaoImpl.setSysLogPath(input);
		try {
			proxyIssueDaoImpl.deleteProxyIssue(input, proxyIssue);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	@EJB(mappedName = "cardmanagement.impl.CardClassicBindMerchantDaoImpl")
	private CardClassicBindMerchantDao cardClassicBindMerchantDaoImpl;

	/**
	 * 根据商户号查询
	 * 
	 * @param merchantNo
	 * @return
	 */
	public List<CardClassicBindMerchant> getCardClassicBindMerchatListByMerchantNo(
			PCPSWebInput webInput, String merchantNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return cardClassicBindMerchantDaoImpl
				.getCardClassicBindMerchatListByMerchantNo(merchantNo);
	}

	/**
	 * 插入新的绑定关系
	 * 
	 * @param CardClassicBindMerchant
	 *            对象
	 */
	public CommonWebResult insertCardClassicBindMerchant(PCPSWebInput webInput,
			String merchantNo, BigInteger[] arrInt) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			cardClassicBindMerchantDaoImpl.insertCardClassicBindMerchant(
					merchantNo, arrInt);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据卡种类查询商户列表
	 * 
	 * @param webInput
	 * @param cardClassid
	 * @return
	 */
	public List<Merchant> getMerchantListByCardClassicId(PCPSWebInput webInput,
			BigInteger cardClassid, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return cardClassicBindMerchantDaoImpl.getMerchantListByCardClassicId(
				webInput, cardClassid, page);
	}

	/**
	 * 根据卡种类查询商户记录数
	 * 
	 * @param webInput
	 * @param cardClassid
	 * @return
	 */
	public BigInteger getMerchantTotalByCardClassicId(PCPSWebInput webInput,
			BigInteger cardClassid) {
		return cardClassicBindMerchantDaoImpl.getMerchantTotalByCardClassicId(
				webInput, cardClassid);
	}

	/**
	 * 得到发卡商卡种类
	 * 
	 * @param IssueCompanyNo
	 *            发卡商
	 * @return
	 */
	public List<CardClassic> getCardClassicListByIssueCompanyNo(
			PCPSWebInput webInput, String IssueCompanyNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return CardClassicDaoImpl
				.getAllCardClassicByIssueCompanyNo(IssueCompanyNo);
	}

	/**
	 * 卡种类MAP
	 * 
	 * @param input
	 * @return
	 */
	public List<CardClassic> getCardClassicHashMap(PCPSWebInput input) {

		commonDaoImpl.setSysLogPath(input);
		return CardClassicDaoImpl.getCardClassicHashMap(input);
	}

	// 卡种类绑定商圈
	@EJB(mappedName = "cardmanagement.impl.CardClassicBindDistrictDaoImpl")
	private CardClassicBindDistrictDao ccbddaoImpl;

	/**
	 * 根据卡种类查询已绑定的商圈
	 * 
	 * @param cardClassicId
	 * @return
	 */
	public List<CardClassicBindDistrict> getCardClassicBindDistrictListByCardClassicId(
			PCPSWebInput webInput, BigInteger cardClassicId) {

		commonDaoImpl.setSysLogPath(webInput);
		return ccbddaoImpl
				.getCardClassicBindDistrictListByCardClassicId(cardClassicId);
	}

	/**
	 * 绑定
	 * 
	 * @param ccbdList
	 */
	public CommonWebResult insertCardClassicBindDistrict(PCPSWebInput webInput,
			BigInteger cardClassicId, BigInteger[] arrInt) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			ccbddaoImpl.insertCardClassicBindDistrict(cardClassicId, arrInt);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return new CommonWebResult();
	}

	@EJB(mappedName = "cardmanagement.impl.MakeCardApprovalDaoImpl")
	private MakeCardApprovalDao makeCardApprovalDaoImpl;

	/**
	 * 查询单个制卡申请详细信息
	 */
	public MakeCardApproval getMakeCardApprovalByMakeCardApplyForId(
			BigInteger MakeCardApplyForId) {
		return makeCardApprovalDaoImpl
				.getMakeCardApprovalByMakeCardApplyForId(MakeCardApplyForId);
	}

	/**
	 * 修改制卡申请
	 * 
	 * @param webInput
	 * @param mac
	 * @return
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult updateMakeCardApproval(PCPSWebInput webInput,
			MakeCardApproval mac) throws PCPSApplicationException {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			makeCardApprovalBusinessImpl.updateMakeCardApproval(webInput, mac);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 删除制卡申请
	 * 
	 * @param webInput
	 * @param mac
	 * @return
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult deleteMakeCardApproval(PCPSWebInput webInput,
			MakeCardApproval mac) throws PCPSApplicationException {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			makeCardApprovalBusinessImpl.deleteMakeCardApprovalByID(webInput,
					mac);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据登录发卡商,是否全局，时间段，制卡商ID,卡种类ID,卡片面值,状态 组合条件分页查询数据.
	 * 
	 * @param issuecompanyno
	 *            发卡商ID
	 * @param flag
	 *            是否全局，-1查询全局，1查询本机构
	 * @param issuebranchno
	 *            发卡商机构编号
	 * @param starttime
	 *            开始时间 1900-01-01 查全部
	 * @param endtime
	 *            结束时间 1900-01-01 查全部
	 * @param cardManufactureId
	 *            制卡商ID-1 查全部
	 * @param cardClassicId
	 *            卡种类ID-1查全部
	 * @param cardParValueId
	 *            卡面值ID-1查全部
	 * @param status
	 *            状态-1查全部
	 * @param page
	 *            页码 -1查全部
	 * @return
	 */
	public List<MakeCardApproval> getMakeCardApprovalByConditions(
			PCPSWebInput webInput, String issuecompanyno, Integer flag,
			String issuebranchno, Date starttime, Date endtime,
			BigInteger cardManufactureId, BigInteger cardFaceId, String status,
			Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return makeCardApprovalDaoImpl.getMakeCardApprovalByConditions(
				issuecompanyno, flag, issuebranchno, starttime, endtime,
				cardManufactureId, cardFaceId, status, page);
	}

	/**
	 * 根据登录用户ID,制卡商ID,卡种类ID,卡片面值,状态 组合条件分页查询制卡审批表总数.
	 * 
	 * @param OperNo
	 * @param cardManufactureId
	 * @param cardClassicId
	 * @param cardParValueId
	 * @param status
	 * @return
	 */
	public Integer getMakeCardApprovalTotalByConditions(PCPSWebInput webInput,
			String issuecompanyno, Integer flag, String issuebranchno,
			Date starttime, Date endtime, BigInteger cardManufactureId,
			BigInteger cardFaceId, String status) {

		commonDaoImpl.setSysLogPath(webInput);
		return makeCardApprovalDaoImpl.getMakeCardApprovalTotalByConditions(
				issuecompanyno, flag, issuebranchno, starttime, endtime,
				cardManufactureId, cardFaceId, status);
	}

	@EJB(mappedName = "cardmanagement.impl.MakeCardApprovalBusinessImpl")
	private MakeCardApprovalBusiness makeCardApprovalBusinessImpl;
	@EJB(mappedName = "cardmanagement.impl.CardClassicBusinessImpl")
	private CardClassicBusiness cardClassicBusinessImpl;

	/**
	 * @修改卡种类
	 * @param SaleCompany
	 */
	public CommonWebResult updateCardClassicInfo(PCPSWebInput webInput,
			CardClassic CardClassic) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			cardClassicBusinessImpl
					.updateCardClassicInfo(webInput, CardClassic);
		} catch (PCPSApplicationException e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new CommonWebResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new CommonWebResult();
	}

	@EJB(mappedName = "cardmanagement.impl.MakeCardControlBusinessImpl")
	private MakeCardControlBusiness makeCardControlBusiness;
	@EJB(mappedName = "cardmanagement.impl.CardStockBusinessImpl")
	private CardStockBusiness cardStockBusiness;
	@EJB(mappedName = "cardmanagement.impl.MakeCardControlDaoImpl")
	private MakeCardControlDao MakeCardControlDaoImpl;

	/**
	 * 审批制卡申请 ，同意
	 * 
	 * @param MakeCardApplyForId
	 * @param AuthOperNo
	 * 
	 */
	public CommonWebResult approvalMakeCardApproval(PCPSWebInput webInput,
			BigInteger MakeCardApplyForId, BigInteger AuthOperNo) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			makeCardApprovalBusinessImpl.approvalMakeCardApprovalByFINANCE(
					webInput, MakeCardApplyForId, AuthOperNo);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return new CommonWebResult();
	}

	/**
	 * 审批制卡申请 ，拒绝
	 * 
	 * @param MakeCardApplyForId
	 * @param RejectedOperNo
	 * @param RejectedReason
	 */
	public CommonWebResult rejecteMakeCardApproval(PCPSWebInput webInput,
			BigInteger MakeCardApplyForId, BigInteger RejectedOperNo,
			String RejectedReason) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			makeCardApprovalBusinessImpl.rejecteMakeCardApprovalByFINANCE(
					webInput, MakeCardApplyForId, RejectedOperNo,
					RejectedReason);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return new CommonWebResult();
	}

	@EJB(mappedName = "cardmanagement.impl.CardManufactureBusinessImpl")
	private CardManufactureBusiness cardManufactureBusinessImpl;

	@EJB(mappedName = "cardmanagement.impl.CardManufactureDaoImpl")
	private CardManufactureDao cardManufactureDaoImpl;

	/**
	 * 制卡商MAP
	 * 
	 * @param input
	 * @return
	 */
	public List<CardManufacture> getCardManufactureHashMap(PCPSWebInput input) {
		return cardManufactureDaoImpl.getCardManufactureHashMap(input);
	}

	/**
	 * 根据制卡商名称,发卡商id,制卡状态,联系人 获取制卡商总数
	 * 
	 * @return
	 */
	public BigInteger getCardManufacturesCount(PCPSWebInput webInput,
			String cardManufactureName, String issueCompanyNo, String status,
			String linkMan) {
		return cardManufactureBusinessImpl.getCardManufacturesCount(
				cardManufactureName, issueCompanyNo, status, linkMan);
	}

	/**
	 * 制卡商下拉
	 * 
	 * @param input
	 * @return
	 */
	public List<CardManufacture> getCardManufacturesList(PCPSWebInput input) {

		commonDaoImpl.setSysLogPath(input);
		return cardManufactureDaoImpl.getCardManufacturesList(input);
	}

	/**
	 * 根据制卡商名称,发卡商id,制卡状态,联系人 获取制卡商
	 * 
	 * @return
	 */
	public List<CardManufacture> getCardManufactures(PCPSWebInput webInput,
			String cardManufactureName, String issueCompanyNo, String status,
			String linkMan, int page) {

		commonDaoImpl.setSysLogPath(webInput);
		return cardManufactureBusinessImpl.getCardManufactures(
				cardManufactureName, issueCompanyNo, status, linkMan, page);
	}

	/**
	 * 新增制卡商
	 * 
	 * @param cardManufacture
	 * @return
	 */
	public CommonWebResult insertCardManufacture(PCPSWebInput webInput,
			CardManufacture cardManufacture) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			cardManufactureBusinessImpl.insertCardManufacture(webInput,
					cardManufacture);
		} catch (PCPSApplicationException e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new CommonWebResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据制卡商ID获取实例
	 * 
	 * @param cardManufactureId
	 * @return
	 */
	public CardManufacture getCardManufactureByCardManufactureId(
			BigInteger cardManufactureId) {
		return cardManufactureBusinessImpl
				.getCardManufactureByCardManufactureId(cardManufactureId);
	}

	/**
	 * 更新制卡商信息
	 * 
	 * @param cardManufacture
	 * @return
	 */
	public CommonWebResult updateCardManufacture(PCPSWebInput webInput,
			CardManufacture cardManufacture) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			cardManufactureBusinessImpl.updateCardManufacture(webInput,
					cardManufacture);
		} catch (PCPSApplicationException e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new CommonWebResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据主键删除制卡商
	 * 
	 * @param cardManufactureId
	 * @return
	 */
	public CommonWebResult deleteCardManufactureByCardManufactureId(
			PCPSWebInput webInput, BigInteger cardManufactureId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			cardManufactureBusinessImpl
					.deleteCardManufactureByCardManufactureId(webInput,
							cardManufactureId);
		} catch (PCPSApplicationException e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new CommonWebResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new CommonWebResult();
	}

	@EJB(mappedName = "cardmanagement.impl.AdjustInOutStockOrderBusinessImpl")
	private AdjustInOutStockOrderBusiness AdjustInOutStockOrderBusinessImpl;
	@EJB(mappedName = "cardmanagement.impl.AdjustInOutStockOrderDetailDaoImpl")
	private AdjustInOutStockOrderDetailDao AdjustInOutStockOrderDetailDaoImpl;
	@EJB(mappedName = "cardmanagement.impl.TransferInOutStockOrderBusinessImpl")
	private TransferInOutStockOrderBusiness TransferInOutStockOrderBusinessImpl;

	/**
	 * 卡片调拨拒绝接收
	 * 
	 * @param InitialInStockOrder
	 */
	public CommonWebResult regectionTransferInOutStockOrder(
			PCPSWebInput webInput, BigInteger TransferInOutStockOrderID,
			BigInteger operno, String remark) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			TransferInOutStockOrderBusinessImpl
					.regectionTransferInOutStockOrder(webInput,
							TransferInOutStockOrderID, operno, remark);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 查询调整记录机构号，时间范围，交易类型，状态，操作员，审批人
	 * 
	 * @param Branchno
	 * @param StartTime
	 * @param EndTime
	 * @param TranType
	 * @param Status
	 * @param OperId
	 * @param AuthOperId
	 * @return
	 */
	public Integer getAdjustInOutStockOrderCount(PCPSWebInput webInput,
			Integer flag, String Branchno, String StartTime, String EndTime,
			String TranType, String Status, BigInteger OperId,
			BigInteger AuthOperId) {

		commonDaoImpl.setSysLogPath(webInput);
		return AdjustInOutStockOrderDaoImpl.getAdjustInOutStockOrderCount(flag,
				Branchno, StartTime, EndTime, TranType, Status, OperId,
				AuthOperId);
	}

	/**
	 * 条件查询列表，机构号，时间范围，交易类型，状态，操作员，审批人，页码
	 * 
	 * @param Branchno
	 * @param StartTime
	 * @param EndTime
	 * @param TranType
	 * @param Status
	 * @param OperId
	 * @param AuthOperId
	 * @param page
	 */
	public List<AdjustInOutStockOrder> getAdjustInOutStockOrderList(
			PCPSWebInput webInput, Integer flag, String Branchno,
			String StartTime, String EndTime, String TranType, String Status,
			BigInteger OperId, BigInteger AuthOperId, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return AdjustInOutStockOrderDaoImpl.getAdjustInOutStockOrderList(flag,
				Branchno, StartTime, EndTime, TranType, Status, OperId,
				AuthOperId, page);
	}

	/**
	 * 根据AdjustInOutStockOrderId主键查询
	 * 
	 * @param CardParValueId
	 *            卡面值面好
	 * @return AdjustInOutStockOrder对象
	 */
	public AdjustInOutStockOrder getAdjustInOutStockOrderByAdjustInOutStockOrderId(
			BigInteger AdjustInOutStockOrderId) {
		return AdjustInOutStockOrderDaoImpl
				.getAdjustInOutStockOrderByAdjustInOutStockOrderId(AdjustInOutStockOrderId);
	}

	/**
	 * 卡片调整
	 * 
	 * @param AdjustInOutStockOrder
	 * @param List
	 *            <AdjustInOutStockOrderDetail>
	 * 
	 */
	public CommonWebResult newAdjustInOutStockOrderWithDetail(
			PCPSWebInput input, AdjustInOutStockOrder AdjustInOutStockOrder,
			List<AdjustInOutStockOrderDetail> detaillist) {

		commonDaoImpl.setSysLogPath(input);
		CommonWebResult commonWebResult = new CommonWebResult();
		try {
			BigInteger AdjustInOutStockOrderId = AdjustInOutStockOrderBusinessImpl
					.newAdjustInOutStockOrderWithDetail(input,
							AdjustInOutStockOrder, detaillist);
			commonWebResult.setSuccess(true);
			commonWebResult.setResult(AdjustInOutStockOrderId.toString());
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return commonWebResult;
	}

	/**
	 * 卡片调整取消
	 * 
	 * @param AdjustInOutStockOrderID
	 * @param operno
	 * @param remark
	 */
	public CommonWebResult cancelAdjustInOutStockOrderStatus(
			PCPSWebInput webInput, BigInteger AdjustInOutStockOrderID,
			BigInteger operno, String remark) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			AdjustInOutStockOrderBusinessImpl
					.cancelAdjustInOutStockOrderStatus(webInput,
							AdjustInOutStockOrderID, operno, remark);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 删除调整单
	public CommonWebResult deleteAdjustInOutStockOrderStatus(
			PCPSWebInput webInput, BigInteger adjustInOutStockOrderId,
			BigInteger operno, String remark) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			AdjustInOutStockOrderBusinessImpl
					.deleteAdjustInOutStockOrderStatus(webInput,
							adjustInOutStockOrderId, operno, remark);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 调整单审核 调整单ID 审核人 备注 是否通过true通过false不通过
	 * 
	 * @param SaleCompany
	 */
	public CommonWebResult authAdjustInOutStockOrderStatus(
			PCPSWebInput webInput, BigInteger AdjustInOutStockOrderID,
			BigInteger operId, String remark, boolean ispass) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			AdjustInOutStockOrderBusinessImpl.authAdjustInOutStockOrderStatus(
					webInput, AdjustInOutStockOrderID, operId, remark, ispass);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据AdjustInOutStockOrderId批量查询
	 * 
	 * @param AdjustInOutStockOrderId
	 */
	public List<AdjustInOutStockOrderDetail> getAdjustInOutStockOrderDetail(
			PCPSWebInput webInput, BigInteger AdjustInOutStockOrderId) {

		commonDaoImpl.setSysLogPath(webInput);
		return AdjustInOutStockOrderDetailDaoImpl
				.getAdjustInOutStockOrderDetail(AdjustInOutStockOrderId);
	}

	/** 卡面值管理部分 */
	@EJB(mappedName = "cardmanagement.impl.CardParValueDaoImpl")
	private CardParValueDao CardParValueDaoImpl;

	/**
	 * 新增卡面值
	 * 
	 * @param SaleCompany
	 */
	public CommonWebResult insertCardParValue(PCPSWebInput webInput,
			CardParValue CardParValue) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			CardParValueDaoImpl.insertCardParValue(CardParValue);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return new CommonWebResult();
	}

	/**
	 * 删除卡面值
	 * 
	 * @param SaleCompany
	 */
	public CommonWebResult deleteCardParValue(PCPSWebInput webInput,
			BigInteger CardParValueId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			CardParValueDaoImpl.deleteCardParValue(CardParValueId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return new CommonWebResult();
	}

	/**
	 * 获取卡面值
	 * 
	 * @param SaleCompany
	 */
	public List<CardParValue> getCardParValueList(PCPSWebInput webInput) {

		commonDaoImpl.setSysLogPath(webInput);
		return CardParValueDaoImpl.getCardParValueList();
	}

	/**
	 * 根据主键获取卡面值
	 * 
	 * @param SaleCompany
	 */
	public CardParValue getCardParValueByCardParValueId(
			BigInteger CardParValueId) {
		return CardParValueDaoImpl
				.getCardParValueByCardParValueId(CardParValueId);
	}

	/**
	 * 修改卡面值备注 卡面值ID 备注
	 * 
	 * @param SaleCompany
	 */
	public CommonWebResult updateCardParValueRemark(PCPSWebInput webInput,
			BigInteger CardParValueId, String remark) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			CardParValueDaoImpl
					.updateCardParValueRemark(CardParValueId, remark);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return new CommonWebResult();
	}

	/**
	 * 资金管理模块=========================== start
	 */
	// @EJB(mappedName =
	// "capitalaccounts.impl.SaleCreditAdjustBillBusinessImpl")
	// private SaleCreditAdjustBillBusiness saleCreditAdjustBillImpl;
	// @EJB(mappedName = "capitalaccounts.impl.SaleCreditAdjustBillDaoImpl")
	// private SaleCreditAdjustBillDao saleCreditAdjustBillDao;
	//
	// /**
	// * 资金管理----插入调账单
	// *
	// * @param vo
	// * @return
	// */
	// public CommonWebResult insertSaleCreditAdJustBill(PCPSWebInput webInput,
	// SaleCreditAdjustBill vo) {
	// 
	// commonDaoImpl.setSysLogPath(webInput);
	// try {
	// saleCreditAdjustBillImpl.insertSaleCreditAdJustBill(vo);
	// } catch (PCPSApplicationException p) {
	// return PCPSException(p);
	// }
	// return new CommonWebResult();
	// }
	//
	// /**
	// * 资金管理----根据查询调账单总数
	// *
	// * @return
	// */
	// public Integer getSaleCreditAdjustBillTotal(PCPSWebInput webInput,
	// Date startTranDate, Date endTranDate, BigInteger startAmount,
	// BigInteger endAmount, String saleBranchNo) {
	// return saleCreditAdjustBillDao.getSaleCreditAdjustBillTotal(webInput,
	// startTranDate, endTranDate, startAmount, endAmount,
	// saleBranchNo);
	// }
	//
	// /**
	// * 资金管理----根据查询调账单结果
	// *
	// * @return
	// */
	// public List<SaleCreditAdjustBill> getSaleCreditAdjustBillList(
	// PCPSWebInput webInput, Date startTranDate, Date endTranDate,
	// BigInteger startAmount, BigInteger endAmount, String saleBranchNo,
	// Integer page) {
	// 
	// commonDaoImpl.setSysLogPath(webInput);
	// return saleCreditAdjustBillDao.getSaleCreditAdjustBillList(webInput,
	// startTranDate, endTranDate, startAmount, endAmount,
	// saleBranchNo, page);
	// }
	//
	// /**
	// * 资金管理----根据调账单ID获取实例
	// *
	// * @return
	// */
	// public SaleCreditAdjustBill getSaleCreditAdjustBillById(BigInteger id) {
	// return saleCreditAdjustBillDao.getSaleCreditAdjustBillById(id);
	// }
	@EJB(mappedName = "capitalaccounts.impl.SaleCreditDepositBillBusinessImpl")
	private SaleCreditDepositBillBusiness saleCreditDepositBillBusinessImpl;
	@EJB(mappedName = "capitalaccounts.impl.SaleCreditDepositBillDaoImpl")
	private SaleCreditDepositBillDao saleCreditDepositBillDaoImpl;

	/**
	 * 资金管理----根据查询条件获取机构缴款帐单总数
	 * 
	 * @return
	 */
	public BigInteger getSaleCreditDepositBillCount(PCPSWebInput webInput,
			Date startTranDate, Date endTranDate, String saleBranchNo,
			BigInteger startAmount, BigInteger endAmount, String depositType,
			String voucherNo, String isSingle) {

		commonDaoImpl.setSysLogPath(webInput);
		return saleCreditDepositBillDaoImpl.getSaleCreditDepositBillCount(
				webInput, startTranDate, endTranDate, saleBranchNo,
				startAmount, endAmount, depositType, voucherNo, isSingle);
	}

	/**
	 * 资金管理----根据查询条件获取机构缴款帐单列表
	 * 
	 * @return
	 */
	public List<SaleCreditDepositBill> getSaleCreditDepositBill(
			PCPSWebInput webInput, Date startTranDate, Date endTranDate,
			String saleBranchNo, BigInteger startAmount, BigInteger endAmount,
			String depositType, String voucherNo, String isSingle, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return saleCreditDepositBillDaoImpl.getSaleCreditDepositBill(webInput,
				startTranDate, endTranDate, saleBranchNo, startAmount,
				endAmount, depositType, voucherNo, isSingle, page);
	}

	/**
	 * 根据缴款单号主键获取缴款单明细
	 * 
	 * @param id
	 * @return
	 */
	public SaleCreditDepositBill getSaleCreditDepositBillById(BigInteger id) {
		return saleCreditDepositBillDaoImpl.getSaleCreditDepositBillById(id);
	}

	/**
	 * 增加缴款单
	 * 
	 * @param vo
	 */
	public CommonWebResult insertSaleCreditDepositBill(PCPSWebInput webInput,
			SaleCreditDepositBill vo) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			saleCreditDepositBillBusinessImpl.insertSaleCreditDepositBill(
					webInput, vo);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return new CommonWebResult();
	}

	/**
	 * 撤销缴款单
	 * 
	 * @param vo
	 * @return
	 */
	public CommonWebResult cancelSaleCreditDepositBill(PCPSWebInput webInput,
			SaleCreditDepositBill vo) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			saleCreditDepositBillBusinessImpl.cancelSaleCreditDB(webInput, vo);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return new CommonWebResult();
	}

	// 银行帐户信息
	@EJB(mappedName = "capitalaccounts.impl.BankAccountDaoImpl")
	private BankAccountDao bankAccountDaoImpl;

	/**
	 * 根据BankAccountId取得BankAccount对象
	 * 
	 * @param vo
	 * @return
	 */
	public BankAccount getBankAccountByBankAccountId(BigInteger bankAccountId) {
		return bankAccountDaoImpl.getBankAccountByBankAccountId(bankAccountId);
	}

	/**
	 * 根据发卡商号获取
	 * 
	 * @param issueCompanyNo
	 * @return
	 */
	public List<BankAccount> getBankAccountByIssueCompanyNo(
			String issueCompanyNo) {
		return bankAccountDaoImpl
				.getBankAccountByIssueCompanyNo(issueCompanyNo);
	}

	/**
	 * 记录数
	 * 
	 * @param bankName
	 * @param accountName
	 * @param accountNo
	 * @return
	 */
	public BigInteger getBankAccountTotalByCondition(PCPSWebInput webInput,
			String bankName, String accountName, String accountNo,
			String bankType) {
		return bankAccountDaoImpl.getBankAccountTotalByCondition(webInput,
				bankName, accountName, accountNo, bankType);
	}

	/**
	 * 列表
	 * 
	 * @param bankName
	 * @param accountName
	 * @param accountNo
	 * @return
	 */
	public List<BankAccount> getBankAccountListByCondition(
			PCPSWebInput webInput, String bankName, String accountName,
			String accountNo, String bankType, Integer pages) {

		commonDaoImpl.setSysLogPath(webInput);
		return bankAccountDaoImpl.getBankAccountListByCondition(webInput,
				bankName, accountName, accountNo, bankType, pages);
	}

	/**
	 * 付款人银行下拉选择
	 * 
	 * @param webInput
	 * @return
	 */
	public List<BankAccount> getBankAccountDropdown(PCPSWebInput webInput,
			String bankType) {

		commonDaoImpl.setSysLogPath(webInput);
		return bankAccountDaoImpl.getBankAccountDropdown(webInput, bankType);
	}

	/**
	 * 新增银行帐户信息
	 * 
	 * @param bankAccount
	 */
	public CommonWebResult insertBankAccount(PCPSWebInput webInput,
			BankAccount bankAccount) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			bankAccountDaoImpl.insertBankAccount(webInput, bankAccount);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改银行帐户信息
	 * 
	 * @param bankAccount
	 */
	public CommonWebResult updateBankAccount(PCPSWebInput webInput,
			BankAccount bankAccount) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			bankAccountDaoImpl.updateBankAccount(webInput, bankAccount);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 删除银行帐户信息
	 * 
	 * @param bankAccountId
	 */
	public CommonWebResult deleteBankAccountByBankAccountId(
			PCPSWebInput webInput, BigInteger bankAccountId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			bankAccountDaoImpl.deleteBankAccountByBankAccountId(bankAccountId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	//
	@EJB(mappedName = "capitalaccounts.impl.SaleCashWithdrawBillDaoImpl")
	private SaleCashWithdrawBillDao saleCashWithdrawBillDaoImpl;
	@EJB(mappedName = "capitalaccounts.impl.SaleCashWithdrawBillBusinessImpl")
	private SaleCashWithdrawBillBusiness saleCashWithdrawBillBusinessImpl;

	/**
	 * 根据主键查询
	 * 
	 * @param drawBillId
	 * @return
	 */
	public SaleCashWithdrawBill getSaleCashWithdrawBillById(
			BigInteger drawBillId) {
		return saleCashWithdrawBillDaoImpl
				.getSaleCashWithdrawBillById(drawBillId);
	}

	/**
	 * 销售机构上存/缴现金支出单列表
	 * 
	 * @param webInput
	 * @param startTranDate
	 * @param endTranDate
	 * @param startAmount
	 * @param endAmount
	 * @param saleBranchNo
	 * @param page
	 * @return
	 */
	public List<SaleCashWithdrawBill> getSaleCashWithdrawBillList(
			PCPSWebInput webInput, String startTranDate, String endTranDate,
			BigInteger startAmount, BigInteger endAmount, String saleBranchNo,
			Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return saleCashWithdrawBillDaoImpl.getSaleCashWithdrawBillList(
				webInput, startTranDate, endTranDate, startAmount, endAmount,
				saleBranchNo, page);
	}

	/**
	 * 销售机构上存/缴现金支出单总数
	 * 
	 * @param webInput
	 * @param startTranDate
	 * @param endTranDate
	 * @param startAmount
	 * @param endAmount
	 * @param saleBranchNo
	 * @return
	 */
	public BigInteger getSaleCashWithdrawBillTotal(PCPSWebInput webInput,
			String startTranDate, String endTranDate, BigInteger startAmount,
			BigInteger endAmount, String saleBranchNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return saleCashWithdrawBillDaoImpl.getSaleCashWithdrawBillTotal(
				webInput, startTranDate, endTranDate, startAmount, endAmount,
				saleBranchNo);
	}

	/**
	 * 
	 * 销售机构上存/缴现金支出单撤销
	 * 
	 * @param webInput
	 * @param saleCashWithdrawBill
	 * @return
	 */
	public CommonWebResult cancelSaleCashWithdrawBill(PCPSWebInput webInput,
			SaleCashWithdrawBill saleCashWithdrawBill) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			saleCashWithdrawBillBusinessImpl.cancelSaleCashWithdrawBill(
					webInput, saleCashWithdrawBill);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 销售机构上存/缴现金支出单录入
	 * 
	 * @param webInput
	 * @param saleCashWithdrawBill
	 * @return
	 */
	public CommonWebResult insertSaleCashWithdrawBill(PCPSWebInput webInput,
			SaleCashWithdrawBill saleCashWithdrawBill, BankAccountDetail bankAcc) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			saleCashWithdrawBillBusinessImpl.insertSaleCashWithdrawBill(
					webInput, saleCashWithdrawBill, bankAcc);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 资金管理模块=========================== end
	 */
	/**
	 * 制卡
	 * 
	 * @param userid
	 * @param BatchNo
	 */
	public CommonWebResult makeCard(PCPSWebInput webInput,
			BigInteger MakeCardApplyForId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			makeCardControlBusiness.makeCard(webInput, MakeCardApplyForId);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getMessage(), p);
			return PCPSException(p);
		} catch (Exception ex) {
			PCPSUtil.Log(ex.getMessage());
			return CommonException(ex);
		}
		return new CommonWebResult();
	}

	/**
	 * 提取制卡文件
	 * 
	 * @param userid
	 * @param BatchNo
	 */
	public byte[] downFile(PCPSWebInput webInput, BigInteger userid,
			String BatchNo) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			return makeCardControlBusiness.downFile(webInput, userid, BatchNo);
		} catch (PCPSApplicationException e) {
			PCPSUtil.Log(e.getMessage(), e);
			return null;
		} catch (Exception ex) {
			PCPSUtil.Log(ex.getMessage());
			return null;
		}
	}

	/**
	 * 卡片入库
	 * 
	 * @param InitialInStockOrder
	 */
	public String[] putInCardStock(PCPSWebInput webInput,
			InitialInStockOrder InitialInStockOrder) {

		commonDaoImpl.setSysLogPath(webInput);
		String[] s = new String[2];
		try {
			BigInteger b = cardStockBusiness.putInCardStock(webInput,
					InitialInStockOrder);
			s[0] = b.toString();
			return s;
		} catch (PCPSApplicationException e) {
			PCPSUtil.Log(e.getMessage(), e);
			s[0] = "0";
			s[1] = e.getErrMsg();
			return s;
		} catch (Exception ex) {
			PCPSUtil.Log(ex.getMessage(), ex);
			s[0] = "0";
			s[1] = ex.getMessage();
			return s;
		}
	}

	/**
	 * 卡片入库取消
	 * 
	 * @param InitialInStockOrderId
	 * @param operno
	 */
	public CommonWebResult putInCancleCardStock(PCPSWebInput webInput,
			InitialInStockOrder _iiso, BigInteger operno) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			cardStockBusiness.putInCancleCardStock(webInput, _iiso, operno);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getMessage(), p);
			return PCPSException(p);
		} catch (Exception ex) {
			PCPSUtil.Log(ex.getMessage(), ex);
			return new CommonWebResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION, ex.getMessage());
		}
		return new CommonWebResult();
	}

	/**
	 * 卡入库审核
	 * 
	 * @param iiso
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult putInCardStockAuth(PCPSWebInput webInput,
			InitialInStockOrder iiso) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			cardStockBusiness.putInCardStockAuth(webInput, iiso);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getMessage(), p);
			return PCPSException(p);
		} catch (Exception ex) {
			PCPSUtil.Log(ex.getMessage(), ex);
			return new CommonWebResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION, ex.getMessage());
		}
		return new CommonWebResult();
	}

	/**
	 * 入库撤销审核
	 * 
	 * @param _iiso
	 * @param operno
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult putInCancleCardStockAuth(PCPSWebInput webInput,
			InitialInStockOrder _iiso, BigInteger operno) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			cardStockBusiness.putInCancleCardStockAuth(webInput, _iiso, operno);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getMessage(), p);
			return PCPSException(p);
		} catch (Exception ex) {
			PCPSUtil.Log(ex.getMessage(), ex);
			return new CommonWebResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION, ex.getMessage());
		}
		return new CommonWebResult();
	}

	/**
	 * 制卡入库列表
	 * 
	 * @param input
	 * @param startDate
	 * @param endDate
	 * @param page
	 * @return
	 */
	public List<InitialInStockOrder> getInitialInStockOrderList(
			PCPSWebInput input, String startDate, String endDate,
			String status, Integer page) {
		return InitialInStockOrderDaoImpl.getInitialInStockOrderList(input,
				startDate, endDate, status, page);
	}

	/**
	 * 制卡入库总数
	 * 
	 * @param input
	 * @param startDate
	 * @param endDate
	 * @param page
	 * @return
	 */
	public Integer getInitialInStockOrderTotal(PCPSWebInput input,
			String startDate, String endDate, String status) {
		return InitialInStockOrderDaoImpl.getInitialInStockOrderTotal(input,
				startDate, endDate, status);
	}

	/**
	 * 根据制卡人编号检索对象
	 * 
	 * @param OperNo
	 *            操作员编号
	 */
	public List<MakeCardControl> getMakeCardControlByOperNo(BigInteger OperNo) {
		try {
			return MakeCardControlDaoImpl.getMakeCardControlByOperNo(OperNo);
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return null;
		}
	}

	/**
	 * 根据批次号 查询单条记录
	 * 
	 * @param BatchNo
	 * 
	 */
	public MakeCardControl getMakeCardControlByBatchNo(String BatchNo) {
		return MakeCardControlDaoImpl.getMakeCardControlByBatchNo(BatchNo);
	}

	/**
	 * 根据制卡机构号和状态检索对象
	 * 
	 * @param branchno
	 * @param status
	 */
	public List<MakeCardControl> getMakeCardControlByIssueBranchNoAndStatus(
			PCPSWebInput webInput, String branchno, String status) {

		return MakeCardControlDaoImpl
				.getMakeCardControlByIssueBranchNoAndStatus(branchno, status);
	}

	public List<Object[]> getReportMakeCardControlByCondition(
			PCPSWebInput webInput, String issueBranchNo, boolean isSingle,
			String startTime, String endTime, String status) {
		return MakeCardControlDaoImpl.getReportMakeCardControlByCondition(
				webInput, issueBranchNo, isSingle, startTime, endTime, status);
	}

	/**
	 * 查询制卡控制列表
	 * 
	 * @param icNo
	 *            发卡商号
	 * @param batchNo
	 *            批次号
	 * @param status ""
	 *            查询全部 2未入库/5 部分入库
	 * @return
	 */
	public List<MakeCardControl> getMakeCardControlList(PCPSWebInput webInput,
			String icNo, String batchNo, String status) {

		commonDaoImpl.setSysLogPath(webInput);
		return MakeCardControlDaoImpl.getMakeCardControlList(icNo, batchNo,
				status);
	}

	/**
	 * 未入库卡查询
	 * 
	 * @param webInput
	 * @param batchNo
	 *            制卡批次号
	 * @return
	 */
	public List<MakeCardControl> getNoInStockCardList(PCPSWebInput webInput,
			String batchNo, String status) {

		commonDaoImpl.setSysLogPath(webInput);
		return MakeCardControlDaoImpl.getNoInStockCardList(webInput, batchNo,
				status);
	}

	/**
	 * 提交制卡申请传入MakeCardApproval对象
	 * 
	 * @param MakeCardApproval
	 *            1.制卡原因 2.操作员号operno 3.卡种类 4.卡面值 5.张数 6.有效期
	 */
	public CommonWebResult creatMakeCardApproval(PCPSWebInput webInput,
			MakeCardApproval mca) {

		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult commonWebResult = new CommonWebResult();
		try {
			BigInteger MakeCardApplyForId = makeCardApprovalBusinessImpl
					.creatMakeCardApproval(webInput, mca);
			commonWebResult.setSuccess(true);
			commonWebResult.setResult(MakeCardApplyForId.toString());
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return commonWebResult;
	}

	/**
	 * 根据登录用户ID,制卡机构号,制卡商ID,卡种类ID,卡片面值,状态 组合条件分页查询制卡审批表.
	 * 
	 * @param OperNo
	 * @param IssueBranchNo
	 * @param cardManufactureId
	 * @param cardClassicId
	 * @param cardParValueId
	 * @param status
	 * @param page
	 * @return
	 */
	public List<MakeCardApproval> getApprovalMakeCardByConditions(
			PCPSWebInput webInput, BigInteger OperNo, String IssueBranchNo,
			BigInteger cardManufactureId, BigInteger cardFaceId, String status,
			Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return makeCardApprovalDaoImpl.getApprovalMakeCardByConditions(OperNo,
				IssueBranchNo, cardManufactureId, cardFaceId, status, page);
	}

	/**
	 * 根据登录用户ID,制卡机构号,制卡商ID,卡种类ID,卡片面值,状态 组合条件分页查询制卡审批表总数.
	 * 
	 * @param OperNo
	 * @param IssueBranchNo
	 * @param cardManufactureId
	 * @param cardClassicId
	 * @param cardParValueId
	 * @param status
	 * @return
	 */
	public Integer getApprovalMakeCardTotalByConditions(PCPSWebInput webInput,
			BigInteger OperNo, String IssueBranchNo,
			BigInteger cardManufactureId, BigInteger cardFaceId, String status) {

		commonDaoImpl.setSysLogPath(webInput);
		return makeCardApprovalDaoImpl.getApprovalMakeCardTotalByConditions(
				OperNo, IssueBranchNo, cardManufactureId, cardFaceId, status);
	}

	/**
	 * 业务审批制卡申请，根据true代表通过，false代表不通过
	 * 
	 * @param MakeCardApplyForId
	 *            主键
	 * @param AuthOperNo
	 *            操作员
	 * @param reason
	 *            原因
	 * @param ispass
	 *            是否通过true表示通过
	 */
	public CommonWebResult approvalMakeCardApprovalBySale(
			PCPSWebInput webInput, BigInteger MakeCardApplyForId,
			BigInteger AuthOperNo, String reason, boolean ispass) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			if (ispass)
				makeCardApprovalBusinessImpl.approvalMakeCardApprovalBySale(
						webInput, MakeCardApplyForId, AuthOperNo);
			else
				makeCardApprovalBusinessImpl.rejecteMakeCardApprovalBySale(
						webInput, MakeCardApplyForId, AuthOperNo, reason);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return new CommonWebResult();
	}

	/**
	 * 财务审批制卡申请，根据true代表通过，false代表不通过
	 * 
	 * @param MakeCardApplyForId
	 *            主键
	 * @param AuthOperNo
	 *            操作员
	 * @param reason
	 *            原因
	 * @param ispass
	 *            是否通过true表示通过
	 */
	public CommonWebResult approvalMakeCardApprovalByFINANCE(
			PCPSWebInput webInput, BigInteger MakeCardApplyForId,
			BigInteger AuthOperNo, String reason, boolean ispass) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			if (ispass)
				makeCardApprovalBusinessImpl.approvalMakeCardApprovalByFINANCE(
						webInput, MakeCardApplyForId, AuthOperNo);
			else
				makeCardApprovalBusinessImpl.rejecteMakeCardApprovalByFINANCE(
						webInput, MakeCardApplyForId, AuthOperNo, reason);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return new CommonWebResult();
	}

	@EJB(mappedName = "cardmanagement.impl.AdjustInOutStockOrderDaoImpl")
	private AdjustInOutStockOrderDao AdjustInOutStockOrderDaoImpl;
	@EJB(mappedName = "cardmanagement.impl.TransferInOutStockOrderDaoImpl")
	private TransferInOutStockOrderDao TransferInOutStockOrderDaoImpl;
	@EJB(mappedName = "cardmanagement.impl.TransferInOutStockOrderDetailDaoImpl")
	private TransferInOutStockOrderDetailDao TransferInOutStockOrderDetailDaoImpl;

	/**
	 * @查询调拨单明细，根据调拨单id查询
	 * @param SaleCompany
	 */
	public List<TransferInOutStockOrderDetail> getTransferInOutStockOrderDetail(
			PCPSWebInput webInput, BigInteger TransferInOutStockOrderDetailID) {

		commonDaoImpl.setSysLogPath(webInput);
		return TransferInOutStockOrderDetailDaoImpl
				.getTransferInOutStockOrderDetail(TransferInOutStockOrderDetailID);
	}

	/**
	 * @查询调拨单，出库机构，入库机构，时间段，状态，页码
	 * @param SaleCompany
	 */
	public List<TransferInOutStockOrder> getFromTransferInOutStockOrderList(
			PCPSWebInput webInput, String fromsysbranch, String tosysbranch,
			String starttime, String endtime, String TransferStatus,
			Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return TransferInOutStockOrderDaoImpl.getTransferInOutStockOrderList(
				fromsysbranch, tosysbranch, starttime, endtime, TransferStatus,
				page);
	}

	/**
	 * @查询调拨单总数，出库机构，入库机构，时间段，状态
	 * @param SaleCompany
	 */
	public Integer getTransferInOutStockOrderCount(PCPSWebInput webInput,
			String fromsysbranch, String tosysbranch, String starttime,
			String endtime, String TransferStatus) {
		return TransferInOutStockOrderDaoImpl.getTransferInOutStockOrderCount(
				fromsysbranch, tosysbranch, starttime, endtime, TransferStatus);
	}

	// 查询调拨单
	public List<TransferInOutStockOrder> getTransferInOutStockOrderListByCond(
			PCPSWebInput webInput, String tosysbranch, String starttime,
			String endtime, String transferStatus, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return TransferInOutStockOrderDaoImpl
				.getTransferInOutStockOrderListByCond(webInput, tosysbranch,
						starttime, endtime, transferStatus, page);
	}

	public Integer getTransferInOutStockOrderTotalByCond(PCPSWebInput webInput,
			String tosysbranch, String starttime, String endtime,
			String transferStatus) {
		return TransferInOutStockOrderDaoImpl
				.getTransferInOutStockOrderTotalByCond(webInput, tosysbranch,
						starttime, endtime, transferStatus);
	}

	/**
	 * @根据TransferInOutStockOrderId主键查询
	 * @param TransferInOutStockOrderId
	 * @return
	 */
	public TransferInOutStockOrder getTransferInOutStockOrderByTransferInOutStockOrderId(
			BigInteger TransferInOutStockOrderId) {
		return TransferInOutStockOrderDaoImpl
				.getTransferInOutStockOrderByTransferInOutStockOrderId(TransferInOutStockOrderId);
	}

	/**
	 * 卡-6 卡库存调拨统计表
	 * 
	 * @param webInput
	 * @param tranDate
	 * @return
	 */
	public List<Object[]> getTransferInOutStockReportByCondition(
			PCPSWebInput webInput, String fromBranchNo, String toBranchNo,
			String isSingle, String ssSingle, String startTime, String endTime,
			String transferStatus) {

		commonDaoImpl.setSysLogPath(webInput);
		return TransferInOutStockOrderDaoImpl
				.getTransferInOutStockReportByCondition(webInput, fromBranchNo,
						toBranchNo, isSingle, ssSingle, startTime, endTime,
						transferStatus);
	}

	/**
	 * 卡片调拨
	 * 
	 * @param InitialInStockOrder
	 */
	public CommonWebResult newTransferInOutStockOrderWithDetail(
			PCPSWebInput webInput,
			TransferInOutStockOrder TransferInOutStockOrder,
			List<TransferInOutStockOrderDetail> detaillist) {

		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult commonWebResult = new CommonWebResult();
		try {
			BigInteger transferInOutStockOrderid = TransferInOutStockOrderBusinessImpl
					.newTransferInOutStockOrderWithDetail(webInput,
							TransferInOutStockOrder, detaillist);
			commonWebResult.setSuccess(true);
			commonWebResult.setResult(transferInOutStockOrderid.toString());
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return commonWebResult;
	}

	/**
	 * @出库方审批新增调拨单,单号，审批人，是否同意true代表同意false代表打回
	 * @param TransferInOutStockOrderId
	 * @param UserId
	 * @param ispass
	 */
	public CommonWebResult AuthTransferInOutStockOrderByFromBranch(
			PCPSWebInput webInput, BigInteger TransferInOutStockOrderId,
			BigInteger UserId, boolean ispass) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			TransferInOutStockOrderBusinessImpl
					.AuthTransferInOutStockOrderByFromBranch(webInput,
							TransferInOutStockOrderId, UserId, ispass);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @接收方接收调拨单,单号，接收人，是否同意true代表同意接收false代表拒收
	 * @param TransferInOutStockOrderId
	 * @param UserId
	 * @param ispass
	 */
	public CommonWebResult AuthTransferInOutStockOrderByToBranch(
			PCPSWebInput webInput, BigInteger TransferInOutStockOrderId,
			BigInteger UserId, String ConfirmCancelRemark, boolean ispass) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			TransferInOutStockOrderBusinessImpl
					.AuthTransferInOutStockOrderByToBranch(webInput,
							TransferInOutStockOrderId, UserId,
							ConfirmCancelRemark, ispass);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @接收调拨单审批方法
	 * @param TransferInOutStockOrderID
	 * @param operno
	 * @param remark
	 * @param ispass
	 *            true 通过false 不通过
	 */
	public CommonWebResult revelveTransferInOutStockOrderApproval(
			PCPSWebInput webInput, BigInteger TransferInOutStockOrderID,
			BigInteger UserId, String remark, boolean ispass) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			TransferInOutStockOrderBusinessImpl
					.revelveTransferInOutStockOrderApproval(webInput,
							TransferInOutStockOrderID, UserId, remark, ispass);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	@EJB(mappedName = "cardmanagement.impl.ActivateCardDaoImpl")
	private ActivateCardDao activateCardDaoImpl;
	@EJB(mappedName = "cardmanagement.impl.ActivateCardBusinessImpl")
	private ActivateCardBusiness activateCardBusinessImpl;
	@EJB(mappedName = "cardtransactions.impl.CardTransBusinessImpl")
	private CardTransBusiness cardTransBusinessImpl;

	/**
	 * 激活卡卡信息查询,根据卡号条件
	 * 
	 * @param cardNo
	 * @return
	 */
	public ActivateCard getActivateCardByCardNo(String cardNo) {
		return activateCardDaoImpl.getActivateCardByCardNo(cardNo);
	}

	/**
	 * 激活卡卡信息查询,根据卡号(或卡序号)条件
	 * 
	 * @param cardNo
	 *            卡号(或卡序号)
	 * @return
	 */
	public ActivateCard getActivateCardByCardNoOrSeqNo(String cardNo) {
		return activateCardDaoImpl.getActivateCardByCardNoOrSeqNo(cardNo);
	}

	@EJB(mappedName = "account.impl.SubAccountDaoImpl")
	private SubAccountDao subAccountDaoImpl;

	/**
	 * cardTransBusinessImpl 根据卡号或卡序号获取子账户列表
	 * 
	 * @param cardNo
	 * @return
	 */
	public List<SubAccount> getSubAccListByCardNoOrCardSeqNo(
			PCPSWebInput webInput, String cardNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return subAccountDaoImpl.getSubAccListByCardNoOrCardSeqNo(webInput,
				cardNo);
	}

	/**
	 * 根据2、3磁道查询卡号，卡序号
	 * 
	 * @param webInput
	 * @param mode
	 *            mode=null 先查询cardstock 再查询activatecard, mode=1 查询cardstock,
	 *            mode=2 查询 activatecard
	 * @param track2
	 *            2磁道
	 * @param track3
	 *            3磁道
	 * @return
	 */
	public String[] getCardNoByTrack23(PCPSWebInput webInput, String mode,
			String track2, String track3) {

		commonDaoImpl.setSysLogPath(webInput);
		return activateCardDaoImpl.getCardNoByTrack23(webInput, mode, track2,
				track3);
	}

	@EJB(mappedName = "cardmanagement.impl.CardLossDaoImpl")
	private CardLossDao cardLossDaoImpl;

	/**
	 * 根据卡挂失id获取卡挂失对象
	 * 
	 * @param cardLossId
	 * @return
	 */
	public CardLoss getCardLossByCardLossId(BigInteger cardLossId) {
		return cardLossDaoImpl.getCardLossByCardLossId(cardLossId);
	}

	/**
	 * 卡临时挂失
	 * 
	 * @param webInput
	 * @param cardNo
	 * @param remark
	 * @return
	 */
	public CommonWebResult cardTemporaryLoss(PCPSWebInput webInput,
			String cardNo, String remark) {
		commonDaoImpl.setSysLogPath(webInput);
		String re = null;
		try {
			re = activateCardBusinessImpl.cardTemporaryLoss(webInput, cardNo,
					remark);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		CommonWebResult cwr = new CommonWebResult();
		cwr.setResult(re);
		return cwr;
	}

	/**
	 * 卡临时挂失(收费)
	 * 
	 * @param webInput
	 * @param cardNo
	 * @param remark
	 * @return
	 */
	public CardLossResult cardTemporaryLossCharge(PCPSWebInput webInput,
			CardLossObject clObj) {
		commonDaoImpl.setSysLogPath(webInput);
		CardLossObject result = null;
		try {
			result = cardTransBusinessImpl.cardTemporaryLoss(webInput, clObj);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new CardLossResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new CardLossResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new CardLossResult(result);
	}

	/**
	 * 卡解除挂失(收费)
	 * 
	 * @param webInput
	 * @param cardNo
	 * @param remark
	 * @return
	 */
	public CardLossResult cardRelieveLossCharge(PCPSWebInput webInput,
			CardLossObject clObj) {
		commonDaoImpl.setSysLogPath(webInput);
		CardLossObject result = null;
		try {
			result = cardTransBusinessImpl.cardRelieveLoss(webInput, clObj);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new CardLossResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new CardLossResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new CardLossResult(result);
	}

	/**
	 * 卡正式挂失
	 * 
	 * @param webInput
	 * @param clObj
	 * @return
	 */
	public CardLossResult cardOfficialLoss(PCPSWebInput webInput,
			CardLossObject clObj) {

		commonDaoImpl.setSysLogPath(webInput);
		CardLossObject result = null;
		try {
			result = cardTransBusinessImpl.cardOfficialLoss(webInput, clObj);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new CardLossResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new CardLossResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new CardLossResult(result);
	}

	/**
	 * 打印单据后修改卡特殊业务事件凭证信息
	 * 
	 * @param webInput
	 * @param cardEventLogId
	 * @param voucherNo @
	 */
	public CommonWebResult updateCardEventLogVoucherNo(PCPSWebInput webInput,
			BigInteger cardEventLogId, String voucherNo, String businessType) {

		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult cwr = new CommonWebResult();
		try {
			cardTransBusinessImpl.updateCardEventLogVoucherNo(webInput,
					cardEventLogId, voucherNo, businessType);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return cwr;
	}

	/**
	 * 打印单据后修改卡挂失事件凭证信息
	 * 
	 * @param webInput
	 * @param cardEventLogId
	 * @param voucherNo @
	 */
	public CommonWebResult updateCardLossVoucherNo(PCPSWebInput webInput,
			BigInteger cardLossId, String voucherNo, String businessType) {

		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult cwr = new CommonWebResult();
		try {
			cardTransBusinessImpl.updateCardLossVoucherNo(webInput, cardLossId,
					voucherNo, businessType);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return cwr;
	}

	/**
	 * 卡解挂失
	 * 
	 * @param webInput
	 * @param cardNo
	 * @param remark
	 * @return
	 */
	public CommonWebResult cardRelieveLoss(PCPSWebInput webInput,
			String cardNo, String remark) {

		commonDaoImpl.setSysLogPath(webInput);
		String re = null;
		try {
			re = activateCardBusinessImpl.cardRelieveLoss(webInput, cardNo,
					remark);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		CommonWebResult cwr = new CommonWebResult();
		cwr.setResult(re);
		return cwr;
	}

	/**
	 * 解除卡密码锁定(收费)
	 * 
	 * @param webInput
	 * @param cardNo
	 * @return
	 */
	public CardLossResult resetPwdErrCntCharge(PCPSWebInput webInput,
			CardLossObject clObj) {
		commonDaoImpl.setSysLogPath(webInput);
		CardLossObject result = null;
		try {
			result = cardTransBusinessImpl.resetPwdErrCnt(webInput, clObj);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new CardLossResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new CardLossResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new CardLossResult(result);
	}

	/**
	 * 解除卡密码锁定
	 * 
	 * @param webInput
	 * @param cardNo
	 * @return
	 */
	public CommonWebResult resetPwdErrCnt(PCPSWebInput webInput, String cardNo) {

		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult result = new CommonWebResult();
		try {
			result.setResult(activateCardBusinessImpl.resetPwdErrCnt(webInput,
					cardNo).toString());
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return result;
	}

	/**
	 * 卡手工锁定(收费)
	 * 
	 * @param webInput
	 * @param clObj
	 * @return
	 * @throws PCPSApplicationException
	 */
	public CardLossResult cardManualLockCharge(PCPSWebInput webInput,
			CardLossObject clObj) throws PCPSApplicationException {
		commonDaoImpl.setSysLogPath(webInput);
		CardLossObject result = null;
		try {
			result = cardTransBusinessImpl.cardManualLock(webInput, clObj);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new CardLossResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new CardLossResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new CardLossResult(result);
	}

	/**
	 * 手工锁定卡状态 锁定
	 * 
	 * @param cardNo
	 */
	public CommonWebResult cardManualLock(PCPSWebInput webInput, String cardNo,
			String remark) {
		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult result = new CommonWebResult();
		try {
			result.setResult(activateCardBusinessImpl.cardManualLock(webInput,
					cardNo, remark));
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return result;
	}

	/**
	 * 卡解除手工锁定(收费)
	 * 
	 * @param webInput
	 * @param clObj
	 * @return
	 * @throws PCPSApplicationException
	 */
	public CardLossResult cardManualLockFreeCharge(PCPSWebInput webInput,
			CardLossObject clObj) throws PCPSApplicationException {
		commonDaoImpl.setSysLogPath(webInput);
		CardLossObject result = null;
		try {
			result = cardTransBusinessImpl.cardManualLockFree(webInput, clObj);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new CardLossResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new CardLossResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new CardLossResult(result);
	}

	/**
	 * 卡补磁
	 * 
	 * @param webInput
	 * @param cmObj
	 * @return
	 * @throws PCPSApplicationException
	 */
	public CardMagneticResult cardMagnetic(PCPSWebInput webInput,
			CardMagneticObject cmObj) throws PCPSApplicationException {
		commonDaoImpl.setSysLogPath(webInput);
		CardMagneticObject result = null;
		try {
			result = cardTransBusinessImpl.cardMagnetic(webInput, cmObj);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new CardMagneticResult(PCPSUtil.FAILED, p
					.getErrCodeCategory(), p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new CardMagneticResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new CardMagneticResult(result);
	}

	/**
	 * 手工锁定卡状态 解除锁定
	 * 
	 * @param cardNo
	 */
	public CommonWebResult cardManualLockFree(PCPSWebInput webInput,
			String cardNo, String remark) {
		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult result = new CommonWebResult();
		try {
			result.setResult(activateCardBusinessImpl.cardManualLockFree(
					webInput, cardNo, remark));
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return result;
	}

	/**
	 * 登记或变更实名信息
	 * 
	 * @param webInput
	 * @param cardNo
	 * @param personalId
	 * @param remark @
	 */
	public CardOwnerResult cardAssociateOwnerId(PCPSWebInput webInput,
			CardOwnerObject coObj) {

		commonDaoImpl.setSysLogPath(webInput);
		CardOwnerObject result = null;
		try {
			result = cardTransBusinessImpl
					.cardAssociateOwnerId(webInput, coObj);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new CardOwnerResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new CardOwnerResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new CardOwnerResult(result);
	}

	// @EJB(mappedName = "account.impl.SubAccountDetailDaoImpl")
	// private SubAccountDetailDao subAccountDetailDaoImpl;
	// /**
	// * 组合条件查询子账户交易明细
	// * @param webInput
	// * @param cardNo
	// * @param startTime
	// * @param endTime
	// * @param page
	// * @return
	// */
	// public List<SubAccountDetail> getSubAccDetailListByCondition(
	// PCPSWebInput webInput, String cardNo, BigInteger subAccNo,
	// String startTime, String endTime, Integer page)
	// {
	// return subAccountDetailDaoImpl.getSubAccDetailListByCondition(webInput,
	// cardNo, subAccNo, startTime, endTime, page);
	// }
	// /**
	// * 组合条件查询子账户交易明细总数
	// * @param webInput
	// * @param cardNo
	// * @param startTime
	// * @param endTime
	// * @return
	// */
	// public BigInteger getSubAccDetailListTotal(PCPSWebInput webInput,
	// String cardNo, BigInteger subAccNo, String startTime, String endTime)
	// {
	// return subAccountDetailDaoImpl.getSubAccDetailListTotal(webInput,
	// cardNo, subAccNo, startTime, endTime);
	// }

	@EJB(mappedName = "account.impl.AccountSystemAddTradDetailDaoImpl")
	private AccountSystemAddTradDetailDao accSysTradDetailDaoImpl;

	/**
	 * 根据输入条件,查询账户交易附加流水(pcps和自助网站:卡交易明细查询)
	 * 
	 * @param webInput
	 * @param cardNo
	 * @param startTime
	 * @param endTime
	 * @param page
	 * @return
	 */
	public List<AccountSystemAddTradDetail> getAccountSystemAddTradDetailByCondition(
			PCPSWebInput webInput, String cardNo, String startTime,
			String endTime, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return accSysTradDetailDaoImpl
				.getAccountSystemAddTradDetailByCondition(webInput, cardNo,
						startTime, endTime, page);
	}

	/**
	 * 根据输入条件,查询账户交易附加流水(pcps和自助网站:卡交易明细查询) 总数
	 * 
	 * @param webInput
	 * @param cardNo
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	public BigInteger getAccountSystemAddTradDetailTotalByCondition(
			PCPSWebInput webInput, String cardNo, String startTime,
			String endTime) {

		commonDaoImpl.setSysLogPath(webInput);
		return accSysTradDetailDaoImpl
				.getAccountSystemAddTradDetailTotalByCondition(webInput,
						cardNo, startTime, endTime);
	}

	/**
	 * 查询卡挂失信息列表
	 * 
	 * @param webInput
	 * @param CardNo
	 * @param tranType
	 * @param cardHolder
	 * @param startTime
	 * @param endTime
	 * @param saleBranchNo
	 * @param page
	 * @return
	 */
	public List<CardLoss> getCardLossListByCondition(PCPSWebInput webInput,
			String cardNo, String tranType, String cardHolder,
			String startTime, String endTime, String saleBranchNo, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return cardLossDaoImpl.getCardLossListByCondition(webInput, cardNo,
				tranType, cardHolder, startTime, endTime, saleBranchNo, page);
	}

	/**
	 * 查询卡挂失信息列表总数
	 * 
	 * @param webInput
	 * @param cardNo
	 * @param tranType
	 * @param cardHolder
	 * @param startTime
	 * @param endTime
	 * @param saleBranchNo
	 * @param page
	 * @return
	 */
	public BigInteger getCardLossTotalByCondition(PCPSWebInput webInput,
			String cardNo, String tranType, String cardHolder,
			String startTime, String endTime, String saleBranchNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return cardLossDaoImpl.getCardLossTotalByCondition(webInput, cardNo,
				tranType, cardHolder, startTime, endTime, saleBranchNo);
	}

	/**
	 * 修改卡挂失代理人，挂失人图片编号
	 * 
	 * @param cl
	 * is==true 挂失人图片 is==false 代理人图片 @
	 */
	public CommonWebResult updateCardLossImageId(PCPSWebInput webInput,
			BigInteger cardLossId, BigInteger imageId, boolean is) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			cardLossDaoImpl.updateCardLossImageId(cardLossId, imageId, is);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据卡号修改密码
	 * 
	 * @param cardNo
	 *            卡号
	 * @param oldPwd
	 *            原密码
	 * @param newPwd
	 *            新密码
	 * @param operId
	 *            操作员ID
	 * @param remark
	 *            备注
	 * @return
	 */
	public CommonWebResult changeCardPassword(PCPSWebInput webInput,
			String cardNo, String oldPwd, String newPwd, BigInteger operId,
			String remark) {

		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult result = new CommonWebResult();
		try {
			result.setResult(cardTransBusinessImpl.ChangePassword(cardNo,
					oldPwd, newPwd, operId, remark));
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return result;
	}

	/**
	 * 修改卡密码(收费)
	 * 
	 * @param webInput
	 * @param rpObj
	 * @return
	 */
	public ResetPasswordResult ChangePasswordCharge(PCPSWebInput webInput,
			ResetPasswordObject rpObj) {
		commonDaoImpl.setSysLogPath(webInput);
		ResetPasswordObject result = null;
		try {
			result = cardTransBusinessImpl
					.ChangePasswordCharge(webInput, rpObj);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new ResetPasswordResult(PCPSUtil.FAILED, p
					.getErrCodeCategory(), p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new ResetPasswordResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new ResetPasswordResult(result);
	}

	/**
	 * 密码重置
	 * 
	 * @param cardNo
	 *            卡号
	 * @param newPwd
	 *            新密码
	 * @param operId
	 *            操作员ID
	 * @param remark
	 *            备注
	 * @return
	 */
	public ResetPasswordResult ResetPassword(PCPSWebInput webInput,
			ResetPasswordObject rpObj) {

		commonDaoImpl.setSysLogPath(webInput);
		ResetPasswordObject result = null;
		try {
			result = cardTransBusinessImpl.ResetPassword(webInput, rpObj);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new ResetPasswordResult(PCPSUtil.FAILED, p
					.getErrCodeCategory(), p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new ResetPasswordResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new ResetPasswordResult(result);
	}

	/**
	 * 卡延期
	 * 
	 * @param extendExpiredObject
	 *            对象
	 * @return
	 */
	public ExtendExpiredResult CardExtendExpired(PCPSWebInput webInput,
			ExtendExpiredObject extendExpiredObject) {

		commonDaoImpl.setSysLogPath(webInput);
		ExtendExpiredObject res = null;
		try {
			res = cardTransBusinessImpl.ExtendExpired(webInput,
					extendExpiredObject);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new ExtendExpiredResult(PCPSUtil.FAILED, p
					.getErrCodeCategory(), p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new ExtendExpiredResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new ExtendExpiredResult(res);
	}

	/**
	 * 挂失补发新卡
	 * 
	 * @param issueNewCardObject
	 *            对象
	 * @return
	 */
	public IssueNewCardResult LossReIssueNewCard(PCPSWebInput webInput,
			IssueNewCardObject issueNewCardObject) {

		commonDaoImpl.setSysLogPath(webInput);
		IssueNewCardObject res = null;
		try {
			res = cardTransBusinessImpl.LossReIssueNewCard(webInput,
					issueNewCardObject);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new IssueNewCardResult(PCPSUtil.FAILED, p
					.getErrCodeCategory(), p.getErrMsg());
		} catch (Exception e) {

			PCPSUtil.Log(e.getMessage(), e);
			return new IssueNewCardResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new IssueNewCardResult(res);
	}

	/**
	 * 换发新卡
	 * 
	 * @param issueNewCardObject
	 *            对象
	 * @return
	 */
	public IssueNewCardResult ReIssueNewCard(PCPSWebInput webInput,
			IssueNewCardObject issueNewCardObject) {

		commonDaoImpl.setSysLogPath(webInput);
		IssueNewCardObject res = null;
		try {
			res = cardTransBusinessImpl.ReIssueNewCard(webInput,
					issueNewCardObject);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new IssueNewCardResult(PCPSUtil.FAILED, p
					.getErrCodeCategory(), p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new IssueNewCardResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new IssueNewCardResult(res);
	}

	/**
	 * 变更卡种类
	 * 
	 * @param changeCardClassicObject
	 *            对象
	 * @return
	 */
	public ChangeCardClassicResult ChangeCardClassic(PCPSWebInput webInput,
			ChangeCardClassicObject changeCardClassicObject) {

		commonDaoImpl.setSysLogPath(webInput);
		ChangeCardClassicObject res = null;
		try {
			res = cardTransBusinessImpl.ChangeCardClassic(webInput,
					changeCardClassicObject);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new ChangeCardClassicResult(PCPSUtil.FAILED, p
					.getErrCodeCategory(), p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new ChangeCardClassicResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new ChangeCardClassicResult(res);
	}

	/**
	 * 单卡现金销售机构充值
	 * 
	 * @param cashDepositObject
	 *            对象
	 * @return
	 */
	public CashDepositResult CardCashDeposit(PCPSWebInput webInput,
			CashDepositObject cashDepositObject) {

		commonDaoImpl.setSysLogPath(webInput);
		CashDepositObject res = null;
		try {
			res = cardTransBusinessImpl
					.CashDeposit(webInput, cashDepositObject);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new CashDepositResult(PCPSUtil.FAILED, p
					.getErrCodeCategory(), p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new CashDepositResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new CashDepositResult(res);
	}

	/**
	 * 单卡现金销售机构充值撤销
	 * 
	 * @param cashDepositObject
	 *            对象
	 * @return
	 */
	public CashDepositResult CancelCardCashDeposit(PCPSWebInput webInput,
			CashDepositObject cashDepositObject) {

		commonDaoImpl.setSysLogPath(webInput);
		CashDepositObject res = null;
		try {
			res = cardTransBusinessImpl.CancelCashDeposit(webInput,
					cashDepositObject);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new CashDepositResult(PCPSUtil.FAILED, p
					.getErrCodeCategory(), p.getErrMsg());
		} catch (Exception e) {

			PCPSUtil.Log(e.getMessage(), e);
			return new CashDepositResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new CashDepositResult(res);
	}

	/**
	 * 充值单记帐
	 * 
	 * @param depositOrderId
	 * @param operId
	 * @return
	 */
	public CommonWebResult AccountDepositOrder(PCPSWebInput webInput,
			BigInteger depositOrderId, BigInteger operId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			cardTransBusinessImpl.AccountDepositOrder(webInput, depositOrderId,
					operId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 充值单记帐撤销
	 * 
	 * @param depositOrderId
	 * @param operId
	 * @param remark
	 * @return
	 */
	public CommonWebResult CancelAccountDepositOrder(PCPSWebInput webInput,
			BigInteger depositOrderId, BigInteger operId, String remark) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			cardTransBusinessImpl.CancelAccountDepositOrder(webInput,
					depositOrderId, operId, remark);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 审核已记帐充值单
	 * 
	 * @param depositOrderId
	 * @param operId
	 * @param remark
	 * @return
	 */
	public CommonWebResult AuthAccountDepositOrder(PCPSWebInput webInput,
			BigInteger depositOrderId, BigInteger operId, String remark) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			cardTransBusinessImpl.AuthAccountDepositOrder(webInput,
					depositOrderId, operId, remark);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 撤销审核已记帐充值单
	 * 
	 * @param depositOrderId
	 * @param operId
	 * @param remark
	 * @return
	 */
	public CommonWebResult CancelAuthAccountDepositOrder(PCPSWebInput webInput,
			BigInteger depositOrderId, BigInteger operId, String remark) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			cardTransBusinessImpl.CancelAuthAccountDepositOrder(webInput,
					depositOrderId, operId, remark);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 冻结
	 * 
	 * @param freezeAccountObject
	 *            对象
	 * @return
	 */
	public FreezeAccountResult FreezeAccount(PCPSWebInput webInput,
			FreezeAccountObject freezeAccountObject) {
		commonDaoImpl.setSysLogPath(webInput);
		FreezeAccountObject res = null;
		try {
			res = cardTransBusinessImpl.FreezeAccount(webInput,
					freezeAccountObject);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new FreezeAccountResult(PCPSUtil.FAILED, p
					.getErrCodeCategory(), p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new FreezeAccountResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new FreezeAccountResult(res);
	}

	/**
	 * 批量卡冻结
	 * 
	 * @param eeObj
	 * 入口参数 @
	 */
	public FreezeAccountResult batchFreezeAccount(PCPSWebInput input,
			FreezeAccountObject faObj) {
		commonDaoImpl.setSysLogPath(input);
		FreezeAccountObject res = null;
		try {
			res = cardTransBusinessImpl.batchFreezeAccount(input, faObj);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new FreezeAccountResult(PCPSUtil.FAILED, p
					.getErrCodeCategory(), p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new FreezeAccountResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new FreezeAccountResult(res);
	}

	/**
	 * 解冻结
	 * 
	 * @param freezeAccountObject
	 *            对象
	 * @return
	 */
	public FreezeAccountResult unFreezeAccount(PCPSWebInput webInput,
			FreezeAccountObject freezeAccountObject) {

		commonDaoImpl.setSysLogPath(webInput);
		FreezeAccountObject res = null;
		try {
			res = cardTransBusinessImpl.UnFreezeAccount(webInput,
					freezeAccountObject);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new FreezeAccountResult(PCPSUtil.FAILED, p
					.getErrCodeCategory(), p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new FreezeAccountResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new FreezeAccountResult(res);
	}

	/**
	 * 批量卡解冻结
	 * 
	 * @param eeObj
	 * 入口参数 @
	 */
	public FreezeAccountResult batchUnFreezeAccount(PCPSWebInput input,
			FreezeAccountObject faObj) {
		commonDaoImpl.setSysLogPath(input);
		FreezeAccountObject res = null;
		try {
			res = cardTransBusinessImpl.batchUnFreezeAccount(input, faObj);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new FreezeAccountResult(PCPSUtil.FAILED, p
					.getErrCodeCategory(), p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new FreezeAccountResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new FreezeAccountResult(res);
	}

	/**
	 * 验证赎回单卡赎回信息
	 * 
	 * @param rdObj
	 * 入口参数 @
	 */
	public RedempResult VerifyCardRedempOrder(PCPSWebInput webInput,
			RedempObject rdObj) {

		commonDaoImpl.setSysLogPath(webInput);
		RedempObject res = null;
		try {
			res = cardTransBusinessImpl.VerifyCardRedempOrder(rdObj);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new RedempResult(PCPSUtil.FAILED, p.getErrCodeCategory(), p
					.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new RedempResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new RedempResult(res);
	}

	/**
	 * 赎回单扣款记帐
	 * 
	 * @param redempOrderId
	 *            赎回单ID
	 * @param operId
	 *            操作员ID
	 * @return @
	 */
	public CommonWebResult AccountRedempOrder(PCPSWebInput webInput,
			BigInteger redempOrderId, BigInteger operId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			cardTransBusinessImpl.AccountRedempOrder(redempOrderId, operId);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new CommonWebResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new CommonWebResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new CommonWebResult();
	}

	@EJB(mappedName = "account.impl.MasterAccountDaoImpl")
	private MasterAccountDao masterAccountDaoImpl;

	/**
	 * 根据主帐号号检索主帐户
	 */
	public MasterAccount getMasterAccountByMasterAccNo(BigInteger masterAccNo) {
		return masterAccountDaoImpl.getMasterAccountByMasterAccNo(masterAccNo);
	}

	public MasterAccount getMasterAccountByCardNo(String cardno) {
		return masterAccountDaoImpl.getMasterAccountByCardNo(cardno);
	}

	// 卡特殊交易(收费)结束
	@EJB(mappedName = "cardmanagement.impl.CardEventLogDaoImpl")
	private CardEventLogDao cardEventLogDaoImpl;

	/**
	 * 卡事件日志查询列表
	 * 
	 * @param webInput
	 * @param startTranDate
	 * @param endTranDate
	 * @param cardNo
	 * @param cardClassicId
	 * @param page
	 * @return
	 */
	public List<CardEventLog> getCardEventLogList(PCPSWebInput webInput,
			String startTranDate, String endTranDate, String cardNo,
			BigInteger cardClassicId, String eventType, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return cardEventLogDaoImpl.getCardEventLogList(webInput, startTranDate,
				endTranDate, cardNo, cardClassicId, eventType, page);
	}

	/**
	 * 卡事件日志查询总数
	 * 
	 * @param webInput
	 * @param startTranDate
	 * @param endTranDate
	 * @param cardNo
	 * @param cardClassicId
	 * @return
	 */
	public BigInteger getCardEventLogCount(PCPSWebInput webInput,
			String startTranDate, String endTranDate, String cardNo,
			BigInteger cardClassicId, String eventType) {
		return cardEventLogDaoImpl.getCardEventLogCount(webInput,
				startTranDate, endTranDate, cardNo, cardClassicId, eventType);
	}

	/**
	 * 根据主键查询卡事件日志
	 * 
	 * @param cardEventId
	 * @return
	 */
	public CardEventLog getCardEventLog(BigInteger cardEventId) {
		return cardEventLogDaoImpl.getCardEventLog(cardEventId);
	}

	/**
	 * 发卡商机构出入库存明细表清单
	 * 
	 * @param webInput
	 * @param page
	 * @return
	 */
	@EJB(mappedName = "report.impl.SaleCardStockDaySettlementDaoImpl")
	private SaleCardStockDaySettlementDao saleCardStockDaySettlementDaoImpl;

	/**
	 * 卡-5 卡库存日结表(销售机构)
	 * 
	 * @param webInput
	 * @param tranDate
	 * @return
	 */
	public List<Object[]> getSaleCardStockDaySettlementReportByCondition(
			PCPSWebInput webInput, String branchNoCond, String startTime,
			String endTime) {
		return saleCardStockDaySettlementDaoImpl
				.getSaleCardStockDaySettlementReportByCondition(webInput,
						branchNoCond, startTime, endTime);
	}

	/**
	 * 卡-5 卡库存日结表(发卡机构)
	 * 
	 * @param webInput
	 * @param tranDate
	 * @return
	 */
	public List<Object[]> getIssueCardStockDaySettlementReportByCondition(
			PCPSWebInput webInput, String branchNoCond, String startTime,
			String endTime) {
		return saleCardStockDaySettlementDaoImpl
				.getIssueCardStockDaySettlementReportByCondition(webInput,
						branchNoCond, startTime, endTime);
	}

	/**
	 * 卡-5 卡库存结余表 合计
	 * 
	 * @param branchNoCond
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	public Integer[] getCardStockCount(String branchNoCond, String startTime,
			String endTime) {
		return saleCardStockDaySettlementDaoImpl.getCardStockCount(
				branchNoCond, startTime, endTime);
	}

	/**
	 * 发卡商机构出入库存明细表清单
	 * 
	 * @param webInput
	 * @param page
	 * @return
	 */
	@EJB(mappedName = "cardmanagement.impl.IssueCardStockDetailDaoImpl")
	private IssueCardStockDetailDao issuecardstockdetaildao;

	public List<IssueCardStockDetail> getIssueCardStockDetailList(
			PCPSWebInput webInput, String IssueBranchNo, String batchNo,
			String starttime, String endtime, String TranType,
			BigInteger cardFaceId, String startSeqNo, String endSeqNo,
			Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return issuecardstockdetaildao.getIssueCardStockDetailList(
				IssueBranchNo, batchNo, starttime, endtime, TranType,
				cardFaceId, startSeqNo, endSeqNo, page);
	}

	/**
	 * 发卡商机构出入库存明细表清单总数
	 * 
	 * @param webInput
	 * @return
	 */
	public Integer getIssueCardStockDetailCount(PCPSWebInput webInput,
			String IssueBranchNo, String batchNo, String starttime,
			String endtime, String TranType, BigInteger cardFaceId,
			String startSeqNo, String endSeqNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return issuecardstockdetaildao.getIssueCardStockDetailCount(
				IssueBranchNo, batchNo, starttime, endtime, TranType,
				cardFaceId, startSeqNo, endSeqNo);
	}

	/**
	 * 销售机构出入库存明细表清单
	 * 
	 * @param webInput
	 * @param page
	 * @return
	 */
	@EJB(mappedName = "cardmanagement.impl.SaleCardStockDetailDaoImpl")
	private SaleCardStockDetailDao salecardstockdetaildao;

	public List<SaleCardStockDetail> getSaleCardStockDetailList(
			PCPSWebInput webInput, String SaleBranchNo, String batchNo,
			String starttime, String endtime, String TranType,
			BigInteger cardFaceId, String startSeqNo, String endSeqNo,
			Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return salecardstockdetaildao.getSaleCardStockDetailList(SaleBranchNo,
				batchNo, starttime, endtime, TranType, cardFaceId, startSeqNo,
				endSeqNo, page);
	}

	/**
	 * 销售机构出入库存明细表清单总数
	 * 
	 * @param webInput
	 * @return
	 */
	public Integer getSaleCardStockDetailCount(PCPSWebInput webInput,
			String SaleBranchNo, String batchNo, String starttime,
			String endtime, String TranType, BigInteger cardFaceId,
			String startSeqNo, String endSeqNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return salecardstockdetaildao.getSaleCardStockDetailCount(SaleBranchNo,
				batchNo, starttime, endtime, TranType, cardFaceId, startSeqNo,
				endSeqNo);
	}

	/**
	 * 根据调拨单号查询迁移明细列表
	 * 
	 * @param 根据
	 *            操作时间，初始处理状态，结束处理状态，操作类型
	 * @return TransferOrderActionDetail对象集合
	 */
	@EJB(mappedName = "cardmanagement.impl.TransferOrderActionDetailDaoImpl")
	private TransferOrderActionDetailDao transferorderactiondetaildao;

	public List<TransferOrderActionDetail> getTransferOrderActionDetailList(
			PCPSWebInput webInput, String StarTime, String EndTime,
			String tnitialStatus, String endStatus, String actionType, int page) {

		commonDaoImpl.setSysLogPath(webInput);
		return transferorderactiondetaildao.getTransferOrderActionDetailList(
				StarTime, EndTime, tnitialStatus, endStatus, actionType, page);
	}

	/**
	 * 根据调拨单号查询迁移明细列表
	 * 
	 * @param 根据
	 *            操作时间，初始处理状态，结束处理状态，操作类型
	 * @return TransferOrderActionDetail对象集合总数
	 */
	public Integer getTransferOrderActionDetailCount(PCPSWebInput webInput,
			String StarTime, String EndTime, String tnitialStatus,
			String endStatus, String actionType) {

		commonDaoImpl.setSysLogPath(webInput);
		return transferorderactiondetaildao.getTransferOrderActionDetailCount(
				StarTime, EndTime, tnitialStatus, endStatus, actionType);
	}

	/**
	 * 根据调拨单号查询迁移明细列表
	 * 
	 * @param TransferOrderId
	 *            调拨单ID
	 * @return TransferOrderActionDetail对象集合
	 */
	public List<TransferOrderActionDetail> getTransferOrderActionDetailByTransferOrderId(
			PCPSWebInput webInput, BigInteger TransferOrderId) {

		commonDaoImpl.setSysLogPath(webInput);
		return transferorderactiondetaildao
				.getTransferOrderActionDetailByTransferOrderId(TransferOrderId);
	}

	/**
	 * 根据申请单迁移明细列表
	 * 
	 * @param 根据
	 *            操作时间，初始处理状态，结束处理状态，操作类型，申请单号
	 * @return MakeCardActionDetail对象集合
	 */
	@EJB(mappedName = "cardmanagement.impl.MakeCardActionDetailDaoImpl")
	private MakeCardActionDetailDao makecardActionDetailDao;

	public List<MakeCardActionDetail> getMakeCardActionDetailList(
			PCPSWebInput webInput, String StarTime, String EndTime,
			String tnitialStatus, String endStatus, String actionType,
			String makecardApplyforId, int page) {

		commonDaoImpl.setSysLogPath(webInput);
		return makecardActionDetailDao.getMakeCardActionDetailList(StarTime,
				EndTime, tnitialStatus, endStatus, actionType,
				makecardApplyforId, page);
	}

	/**
	 * 根据调申请单迁移明细列表
	 * 
	 * @param 根据
	 *            操作时间，初始处理状态，结束处理状态，操作类型
	 * @return MakeCardActionDetail对象集合总数
	 */
	public Integer getMakeCardActionDetailCount(PCPSWebInput webInput,
			String StarTime, String EndTime, String tnitialStatus,
			String endStatus, String actionType, String makecardApplyforId) {

		commonDaoImpl.setSysLogPath(webInput);
		return makecardActionDetailDao.getMakeCardActionDetailCount(StarTime,
				EndTime, tnitialStatus, endStatus, actionType,
				makecardApplyforId);
	}

	/**
	 * 根据申请单号查询迁移明细列表
	 * 
	 * @param MakeCardApplyForId
	 *            调拨单ID
	 * @return MakeCardActionDetail对象集合
	 */
	public List<MakeCardActionDetail> getMakeCardActionDetailByMakeCardApplyForId(
			PCPSWebInput webInput, BigInteger MakeCardApplyForId) {

		commonDaoImpl.setSysLogPath(webInput);
		return makecardActionDetailDao
				.getMakeCardActionDetailByMakeCardApplyForId(MakeCardApplyForId);
	}

	@EJB(mappedName = "common.impl.MerchantOperBusinessImpl")
	private MerchantOperBusiness merchantOperBusinessImpl;

	/**
	 * 添加商户操作员
	 * 
	 * @param merchantOper
	 *            商户操作员
	 */
	public CommonWebResult insertMerchantOper(PCPSWebInput webInput,
			MerchantOper merchantOper) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantOperBusinessImpl.insertMerchantOper(merchantOper);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改商户操作员
	 * 
	 * @param merchantOper
	 *            商户操作员
	 */
	public CommonWebResult updateMerchantOper(PCPSWebInput webInput,
			MerchantOper merchantOper) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantOperBusinessImpl.updateMerchantOper(merchantOper);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据商户操作员主键查询商户操作员信息
	 * 
	 * @param mrchOperId
	 *            商户操作员Id
	 * @return 商户操作员信息
	 */
	public MerchantOper getMerchantOperByMrchOperId(BigInteger mrchOperId) {
		return merchantOperBusinessImpl.getMerchantOperByMrchOperId(mrchOperId);
	}

	/**
	 * 根据商户号分页查询商户所属操作员
	 * 
	 * @param merchantNo
	 *            商户号
	 * @param page
	 *            页数
	 * @return 商户所属操作员列表
	 */
	public List<MerchantOper> getMerchantOpersByMerchantNo(
			PCPSWebInput webInput, String merchantNo, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantOperBusinessImpl.getMerchantOpersByMerchantNo(
				merchantNo, page);
	}

	/**
	 * 根据商户号查询商户所属操作员总数
	 * 
	 * @param merchantNo
	 *            商户号
	 * @return 商户所属操作员总数
	 */
	public Integer getMerchantOpersCountByMerchantNo(String merchantNo) {
		return merchantOperBusinessImpl
				.getMerchantOpersCountByMerchantNo(merchantNo);
	}

	/**
	 * 根据商户操作员id删除操作员
	 * 
	 * @return CommonWebResult
	 */
	public CommonWebResult deleteMerchantOper(PCPSWebInput webInput,
			BigInteger mrchOperId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantOperBusinessImpl.deleteMerchantOper(mrchOperId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 重置密码
	 * 
	 * @return 返回为空证明重置失败 @
	 */
	public String resetMerchantOperPassword(PCPSWebInput webInput,
			MerchantOper merchantOper) {

		commonDaoImpl.setSysLogPath(webInput);
		String newpassword = null;
		try {
			newpassword = merchantOperBusinessImpl.resetMerchantOperPassword(
					webInput, merchantOper);
		} catch (Exception e) {
		}
		return newpassword;
	}

	@EJB(mappedName = "report.impl.AccSysDaySettDaoImpl")
	private AccSysDaySettDao accSysDaySettDaoImpl;

	/**
	 * 获取账户子系统某时间段内的数据列表
	 * 
	 * @param webInput
	 * @param page
	 * @param startDate
	 * @param endDate
	 * @return @
	 */
	public List<AccSysDaySett> getAccSysDaySettList(PCPSWebInput webInput,
			Integer page, String startDate, String endDate) {

		commonDaoImpl.setSysLogPath(webInput);
		return accSysDaySettDaoImpl.getAccSysDaySettList(webInput, page,
				startDate, endDate);
	}

	// 删除商户手续费收入结算策略
	public CommonWebResult deleteMerchantFeeSettlementPolicyByFeePolicyId(
			PCPSWebInput webInput, BigInteger feePolicyId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantFeeSettlementPolicyDaoImpl
					.deleteMerchantFeeSettlementPolicyByFeePolicyId(feePolicyId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 卡-2 XXX入库单报表
	 * 
	 * @param webInput
	 * @param issueBranchNo
	 *            制卡机构号
	 * @param isSingle
	 *            true表示查询单一 ，false表示查询自己和子机构
	 * @param startTime
	 *            入库起始时间
	 * @param endTime
	 *            入库终止时间
	 * @return
	 */
	public List<Object[]> getInitialInStockOrderReportByCondition(
			PCPSWebInput webInput, String issueBranchNo, boolean isSingle,
			String startTime, String endTime) {

		// commonDaoImpl.setSysLogPath(webInput);
		return InitialInStockOrderDaoImpl
				.getInitialInStockOrderReportByCondition(webInput,
						issueBranchNo, isSingle, startTime, endTime);
	}

	/**
	 * 卡-3 XXX请领统计表
	 * 
	 * @param webInput
	 * @param saleBranchNo
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public List<Object[]> getSaleCardStockDetailByCondition(
			PCPSWebInput webInput, String saleBranchNo, String startDate,
			String endDate) {

		commonDaoImpl.setSysLogPath(webInput);
		return salecardstockdetaildao.getSaleCardStockDetailByCondition(
				webInput, saleBranchNo, startDate, endDate);
	}

	/**
	 * 报表查询服务Start
	 */

	@EJB(mappedName = "transaction.impl.MchTradDetailDaoImpl")
	private MchTradDetailDao mchTradDetailDaoImpl;

	/**
	 * 商户交易流程查询
	 * 
	 * @param merchantNo
	 *            商户号
	 * @param mrchBrchNo
	 *            商户机构号
	 * @param terminalNo
	 *            终端号
	 * @param startTime
	 *            起始时间
	 * @param endTime
	 *            终止时间
	 * @param startAmount
	 *            起始金额
	 * @param endAmount
	 *            终止金额
	 * @param tranCode
	 *            交易码
	 * @param page
	 *            页码
	 * @return
	 */
	public List<MchTradDetail> getMchTradDetailListByCondition(
			String issueCompanyNo, String merchantNo, String mrchBrchNo,
			String terminalNo, String startTime, String endTime,
			BigInteger startAmount, BigInteger endAmount, String tranCode,
			String cardNo, Integer page) {
		return mchTradDetailDaoImpl.getMchTradDetailListByCondition(
				issueCompanyNo, merchantNo, mrchBrchNo, terminalNo, startTime,
				endTime, startAmount, endAmount, tranCode, cardNo, page);
	}

	public Integer getMchTradDetailTotalByCondition(String issueCompanyNo,
			String merchantNo, String mrchBrchNo, String terminalNo,
			String startTime, String endTime, BigInteger startAmount,
			BigInteger endAmount, String tranCode, String cardNo) {
		return mchTradDetailDaoImpl.getMchTradDetailTotalByCondition(
				issueCompanyNo, merchantNo, mrchBrchNo, terminalNo, startTime,
				endTime, startAmount, endAmount, tranCode, cardNo);
	}

	/**
	 * 查询商户交易流水详细信息 mtd.setMerchantNo() mtd.setTranDate() mtd.setTranSeqNo()
	 * 
	 * @param mtd
	 * @return
	 */
	public MchTradDetail getMchTradDetailByPrimaryKey(MchTradDetail mtd) {
		return mchTradDetailDaoImpl.getMchTradDetailByPrimaryKey(mtd);
	}

	@EJB(mappedName = "transaction.impl.MchAddTradSummaryDaoImpl")
	private MchAddTradSummaryDao mchAddTradSummaryDaoImpl;

	/**
	 * 根据商户号、交易日期、交易流水号检索商户附加流水
	 * 
	 * @param merchantNo
	 * @param tranDate
	 * @param tranSeqNo
	 * @return
	 */
	public List<MchAddTradSummary> getAllMchAddTradSummaryByTranSeqNo(
			String merchantNo, Date tranDate, String tranSeqNo) {
		return mchAddTradSummaryDaoImpl.getAllMchAddTradSummaryByTranSeqNo(
				merchantNo, tranDate, tranSeqNo);
	}

	@EJB(mappedName = "transaction.impl.MchBsTypeTradDetailDaoImpl")
	private MchBsTypeTradDetailDao mchBsTypeTradDetailDaoImpl;

	/**
	 * 根据商户号、日期、流水号查询商户交易业务类型明细
	 * 
	 * @param merchantNo
	 * @param tranDate
	 * @param tranSeqNo
	 * @return
	 */
	public List<MchBsTypeTradDetail> getAllMchBsTypeTradDetailByTran(
			String merchantNo, Date tranDate, String tranSeqNo) {
		return mchBsTypeTradDetailDaoImpl.getAllMchBsTypeTradDetailByTran(
				merchantNo, tranDate, tranSeqNo);
	}

	@EJB(mappedName = "transaction.impl.MchAddTradDetailDaoImpl")
	private MchAddTradDetailDao mchAddTradDetailDaoImpl;

	/**
	 * 根据商户号、交易日期、交易流水号检索商户附加产品流水
	 * 
	 * @param merchantNo
	 * @param tranDate
	 * @param tranSeqNo
	 * @return
	 */
	public List<MchAddTradDetail> getAllMchAddTradDetailByTranSeqNo(
			String merchantNo, Date tranDate, String tranSeqNo) {
		return mchAddTradDetailDaoImpl.getAllMchAddTradDetailByTranSeqNo(
				merchantNo, tranDate, tranSeqNo);
	}

	@EJB(mappedName = "transaction.impl.MchAddCardDetailDaoImpl")
	private MchAddCardDetailDao mchAddCardDetailDaoImpl;

	/**
	 * 根据商户号、交易日期、交易流水号检索商户附加卡明细
	 * 
	 * @param merchantNo
	 * @param tranDate
	 * @param tranSeqNo
	 * @return
	 */
	public List<MchAddCardDetail> getAllMchAddCardDetailByTranSeqNo(
			String merchantNo, Date tranDate, String tranSeqNo) {
		return mchAddCardDetailDaoImpl.getAllMchAddCardDetailByTranSeqNo(
				merchantNo, tranDate, tranSeqNo);
	}

	/**
	 * 根据商户号、交易日期、交易流水号检索商户卡交易记帐明细
	 * 
	 * @param merchantNo
	 * @param tranDate
	 * @param tranSeqNo
	 * @return
	 */
	public List<MchAccDetail> getAllMchAccDetailByTranSeqNo(String merchantNo,
			Date tranDate, String tranSeqNo) {
		return mchAccDetailDaoImpl.getAllMchAccDetailByTranSeqNo(merchantNo,
				tranDate, tranSeqNo);
	}

	@EJB(mappedName = "report.impl.AccSysBranchDaySettDaoImpl")
	private AccSysBranchDaySettDao accSysBranchDaySettDaoImpl;

	/**
	 * 卡-7:卡消费日报明细表
	 * 
	 * @param webInput
	 * @param saleBranchNo
	 * @param isSingle
	 * @param tranDate
	 * @return
	 */
	public List<Object[]> getCardConsumeDetailReportByCondition(
			PCPSWebInput webInput, String branchNo, String srattranDate,
			String endtranDate) {

		commonDaoImpl.setSysLogPath(webInput);
		return mchTradDetailDaoImpl.getCardConsumeDetailReportByCondition(
				webInput, branchNo, srattranDate, endtranDate);
	}

	/**
	 * 卡-8： XX寄卡余额变动情况表
	 * 
	 * @param saleBranchNo
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public List<Object[]> getAccSysBranchDaySettReportByCondition(
			PCPSWebInput webInput, String saleBranchNo, String startDate,
			String endDate) {

		// commonDaoImpl.setSysLogPath(webInput);
		return accSysBranchDaySettDaoImpl
				.getAccSysBranchDaySettReportByCondition(webInput,
						saleBranchNo, startDate, endDate);
	}

	/**
	 * 卡-9： XXX功能操作明细报表
	 * 
	 * @param webInput
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public List<CardEventLogReport> getCardEventLogReportListByCondition(
			PCPSWebInput webInput, String branchNo, String startDate,
			String endDate) {
		return cardEventLogDaoImpl.getCardEventLogReportListByCondition(
				webInput, branchNo, startDate, endDate);
	}

	/**
	 * 卡-10： XXX功能操作明汇总表
	 * 
	 * @param webInput
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public List<Object[]> getCardEventLogReportCountByCondition(
			PCPSWebInput webInput, String branchNo, String startDate,
			String endDate) {
		return cardEventLogDaoImpl.getCardEventLogReportCountByCondition(
				webInput, branchNo, startDate, endDate);
	}

	/**
	 * 报表 卡-11：西邮寄卡商户渠道充值明细表
	 * 
	 * @param webInput
	 * @param merchantNo
	 * @param merchantBrchNo
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	public List<Object[]> getDepositReportListByCondition(
			PCPSWebInput webInput, String merchantNo, String merchantBrchNo,
			String startTime, String endTime) {

		commonDaoImpl.setSysLogPath(webInput);
		return mchTradDetailDaoImpl.getDepositReportListByCondition(webInput,
				merchantNo, merchantBrchNo, startTime, endTime);
	}

	/**
	 * 报表 卡-12：西邮寄卡商户渠道充值统计表
	 * 
	 * @param webInput
	 * @param merchantNo
	 * @param merchantBrchNo
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	public List<Object[]> getDepositReportCountByCondition(
			PCPSWebInput webInput, String merchantNo, String merchantBrchNo,
			String startTime, String endTime) {

		commonDaoImpl.setSysLogPath(webInput);
		return mchTradDetailDaoImpl.getDepositReportCountByCondition(webInput,
				merchantNo, merchantBrchNo, startTime, endTime);
	}

	@EJB(mappedName = "report.impl.MerchantDaySettlementDaoImpl")
	private MerchantDaySettlementDao merchantDaySettlementDaoImpl;

	/**
	 * 卡-13：渠道交易充值轧差表 商户名称根据商户编号从map中获取 金额前台除100转化为元
	 * 
	 * @param webInput
	 * @param tranDate
	 * @return
	 */
	public List<Object[]> getMerchantDaySettlementCountByCondition(
			PCPSWebInput webInput, String merchantNo, String startDate,
			String endDate, String reportType) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantDaySettlementDaoImpl
				.getMerchantDaySettlementCountByCondition(webInput, merchantNo,
						startDate, endDate, reportType);
	}

	/**
	 * 卡-14：过期卡明细表
	 * 
	 * @param webInput
	 * @return
	 */
	public List<Object[]> getExpiredCardDetailByCondition(
			PCPSWebInput webInput, String serchBranchNo) {
		return activateCardDaoImpl.getExpiredCardDetailByCondition(webInput,
				serchBranchNo);
	}

	/**
	 * 卡-14：过期卡统计表
	 * 
	 * @param webInput
	 * @return
	 */
	public List<Object[]> getExpiredCardCountByCondition(PCPSWebInput webInput,
			String serchBranchNo) {

		return activateCardDaoImpl.getExpiredCardCountByCondition(webInput,
				serchBranchNo);
	}

	/**
	 * 获取销售商分支机构报表
	 * 
	 * @param webInput
	 * @return
	 */
	public List<Object[]> getSaleBranchReport(PCPSWebInput webInput) {

		commonDaoImpl.setSysLogPath(webInput);
		return saleBranchDaoImpl.getSaleBranchReport(webInput);
	}

	/**
	 * 获取发卡商分支机构报表
	 * 
	 * @param webInput
	 * @return
	 */
	public List<Object[]> getIssueBranchReport(PCPSWebInput webInput) {

		commonDaoImpl.setSysLogPath(webInput);
		return issueBranchDaoImpl.getIssueBranchReport(webInput);
	}

	/**
	 * 渠道商户信息统计表
	 * 
	 * @param webInput
	 * @return
	 */
	public List<Object[]> getMerchantReport(PCPSWebInput webInput) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantDaoImpl.getMerchantReport(webInput);
	}

	@EJB(mappedName = "report.impl.MchTradErrLogDaoImpl")
	private MchTradErrLogDao mchTradErrLogDaoImpl;

	public MchTradErrLog getMchTradErrLogByLogId(String logId) {
		return mchTradErrLogDaoImpl.getMchTradErrLogByLogId(logId);
	}

	/**
	 * 检索错误日志
	 * 
	 * @param page
	 *            页号
	 * @param issueCompanyNo
	 *            发卡商号
	 * @param startTime
	 *            起始时间
	 * @param endTime
	 *            终止时间
	 * @param merchantNo
	 *            商户号(可选)
	 * @param cardNo
	 *            卡号(可选)
	 * @return
	 */
	public List<MchTradErrLog> getMchTradErrLogByFilter(Integer page,
			String issueCompanyNo, String startTime, String endTime,
			String merchantNo, String cardNo) {
		return mchTradErrLogDaoImpl.getMchTradErrLogByFilter(page,
				issueCompanyNo, startTime, endTime, merchantNo, cardNo);
	}

	/**
	 * 计算记录数
	 */
	public BigInteger getMchTradErrLogCountByFilter(String issueCompanyNo,
			String startTime, String endTime, String merchantNo, String cardNo) {
		return mchTradErrLogDaoImpl.getMchTradErrLogCountByFilter(
				issueCompanyNo, startTime, endTime, merchantNo, cardNo);
	}

	/**
	 * 商户POS交易日报表
	 * 
	 * @param webInput
	 * @param date
	 * @return
	 */
	public List<Object[]> getMchPOSTradDetailDaySettReport(
			PCPSWebInput webInput, String date) {

		commonDaoImpl.setSysLogPath(webInput);
		return mchTradDetailDaoImpl.getMchPOSTradDetailDaySettReport(webInput,
				date);
	}

	@EJB(mappedName = "transaction.impl.MchChkAccCtlDaoImpl")
	private MchChkAccCtlDao mchChkAccCtlDaoImpl;

	/**
	 * 查询商户对账控制，按商户号、日期范围（默认当天），对账状态综合查询
	 * 
	 * @param merchantNo
	 * @param startDate
	 * @param endDate
	 * @param CheckResult
	 * @return
	 */
	public List<MchChkAccCtl> getMchChkAccCtlListByCondition(
			PCPSWebInput webInput, Integer page, String merchantNo,
			String startDate, String endDate, String checkResult) {

		commonDaoImpl.setSysLogPath(webInput);
		return mchChkAccCtlDaoImpl.getMchChkAccCtlListByCondition(page,
				PCPSUtil.getIssueCompanyNo(webInput), merchantNo, startDate,
				endDate, checkResult);
	}

	public BigInteger getMchChkAccCtlTotalByCondition(PCPSWebInput webInput,
			String merchantNo, String startDate, String endDate,
			String checkResult) {
		return mchChkAccCtlDaoImpl.getMchChkAccCtlTotalByCondition(PCPSUtil
				.getIssueCompanyNo(webInput), merchantNo, startDate, endDate,
				checkResult);
	}

	// /**
	// * 日终汇总统计查询
	// *
	// * @param date
	// * 日终日期
	// * @return
	// */
	// public List<Object[]> getMchChkAccCtlCount(String date) {
	// return mchChkAccCtlDaoImpl.getMchChkAccCtlCount(date);
	// }

	// /**
	// * 日终汇总统计查看明细
	// *
	// * @param date
	// * 日终日期
	// * @param checkResult
	// * 对账结果
	// * @return
	// */
	// public List<MchChkAccCtl> getMchChkAccCtlCountDetail(String date,
	// String checkResult) {
	// return mchChkAccCtlDaoImpl
	// .getMchChkAccCtlCountDetail(date, checkResult);
	// }

	@EJB(mappedName = "transaction.impl.MchChkAccCtlBusinessImpl")
	private MchChkAccCtlBusiness mchChkAccCtlBusinessImpl;

	/**
	 * 根据发卡商NO以及日期统计对帐汇总情况
	 * 
	 * @param issueCompanyNo
	 *            发卡商号
	 * @param tranDate
	 *            帐务日期
	 * @return
	 */
	public MchChkAccCtlSummaryResult getMchChkAccCtlSummaryByTranDate(
			PCPSWebInput webInput, String issueCompanyNo, Date tranDate) {

		commonDaoImpl.setSysLogPath(webInput);
		MchChkAccCtlSummary mcacs = new MchChkAccCtlSummary();
		try {
			mcacs = mchChkAccCtlBusinessImpl.getMchChkAccCtlSummaryByTranDate(
					issueCompanyNo, tranDate);
		} catch (PCPSApplicationException p) {
			return new MchChkAccCtlSummaryResult(PCPSUtil.FAILED, p
					.getErrCodeCategory(), p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new MchChkAccCtlSummaryResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new MchChkAccCtlSummaryResult(mcacs);
	}

	@EJB(mappedName = "report.impl.DaySettlementBusinessImpl")
	private DaySettlementBusiness daySettlementBusinessImpl;
	@EJB(mappedName = "report.impl.BranchDaySettDaoImpl")
	private BranchDaySettDao branchDaySettDaoImpl;

	/**
	 * 商户日切
	 * 
	 * @param merchantNo
	 *            商户号
	 * @param isForce
	 *            是否强行日切
	 * @return
	 */
	public CommonWebResult merchantDayOff(PCPSWebInput webInput,
			String merchantNo, boolean isForce) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			daySettlementBusinessImpl.merchantDayOff(merchantNo, isForce);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 启动异步日终
	 * 
	 * @param issueCompanyNo
	 *            发卡商号
	 * @return
	 */
	public CommonWebResult startDayOff(PCPSWebInput webInput,
			String issueCompanyNo) {
		try {
			daySettlementBusinessImpl.startDayOff(issueCompanyNo);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 产生某发卡商某销售机构某日业务日结数据
	 * 
	 * @param issueCompanyNo
	 * @param tranDate
	 * @param saleBranchNo
	 * @param isOfficial
	 *            true - 正式轧帐 false - 临时轧帐
	 */
	public CommonWebResult generateBranchDaySett(PCPSWebInput webInput,
			String issueCompanyNo, Date tranDate, String saleBranchNo,
			boolean isOfficial) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			daySettlementBusinessImpl.saleBranchDayOffSett(issueCompanyNo,
					tranDate, saleBranchNo, isOfficial);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// public CommonWebResult generateBranchDaySett1(String issueCompanyNo,
	// Date tranDate, String saleBranchNo) {
	// try {
	// daySettlementBusinessImpl.generateBranchDaySett(issueCompanyNo,
	// tranDate, saleBranchNo);
	// } catch (PCPSApplicationException p) {
	// return PCPSException(p);
	// } catch (Exception e) {
	// return CommonException(e);
	// }
	// return new CommonWebResult();
	// }

	/**
	 * 根据条件查询卡商某销售机构某日业务日结数据
	 * 
	 * @param saleBranchNo
	 *            销售机构
	 * @param startTranDate
	 *            起始日期
	 * @param endTranDate
	 * 终止日期 @
	 */
	public List<Object[]> getGenerateBranchDaySettList(PCPSWebInput webInput,
			String saleBranchNo, String startTranDate, String endTranDate) {

		commonDaoImpl.setSysLogPath(webInput);
		return branchDaySettDaoImpl.getGenerateBranchDaySettList(saleBranchNo,
				startTranDate, endTranDate);
	}

	/**
	 * 根据四要素检索商户交易流水
	 * 
	 * @param startTime
	 *            起始日期
	 * @param endTime
	 *            终止日期
	 * @param salebranchNo
	 *            销售机构号
	 * @return 商户交易流水对象列表
	 * 
	 */
	@EJB(mappedName = "transaction.impl.MchHisTradDetailDaoImpl")
	private MchHisTradDetailDao mchHisTradDetailDaoImpl;

	public List<Object[]> getMchHisTradDetailList(PCPSWebInput webInput,
			String startDate, String endDate) {

		commonDaoImpl.setSysLogPath(webInput);
		return mchHisTradDetailDaoImpl.getMchHisTradDetailList(webInput,
				startDate, endDate);
	}

	/**
	 * 根据四要素检索商户交易流水统计--MIS
	 * 
	 * @param startTime
	 *            起始日期
	 * @return 商户交易流水对象列表
	 * 
	 */
	public List<MerchantDaySettlement> getMerchantDaySettlementMisTotal(
			PCPSWebInput webInput, String tranTime, String merchantno) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantDaySettlementDaoImpl.getMerchantDaySettlementMisTotal(
				webInput, tranTime, merchantno);
	}

	/**
	 * 根据四要素检索商户交易流水统计--POS
	 * 
	 * @param startTime
	 *            起始日期
	 * @return 商户交易流水对象列表
	 * 
	 */
	public List<MerchantDaySettlement> getMerchantDaySettlementPosTotal(
			PCPSWebInput webInput, String tranTime, String merchantno) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantDaySettlementDaoImpl.getMerchantDaySettlementPosTotal(
				webInput, tranTime, merchantno);
	}

	/**
	 * 根据两要素检索商户单卡交易明细（非充值卡）
	 * 
	 * @param CardNo
	 *            卡号
	 * @param startTime
	 *            起始日期
	 * @param endTime
	 *            终止日期
	 * @return 商户单卡交易流水对象列表
	 * 
	 */
	public List<Object[]> getMchCardTranlNoDepositList(PCPSWebInput webInput,
			String startDate, String endDate) {

		commonDaoImpl.setSysLogPath(webInput);
		return mchHisTradDetailDaoImpl.getMchCardTranlNoDepositList(webInput,
				startDate, endDate);
	}

	/**
	 * 根据两要素检索持卡人明细
	 * 
	 * @param Name
	 *            姓名
	 * @param CardNo
	 *            卡号
	 * @return 检索清单
	 */
	public List<Object[]> getPersonalCustomCardDatil(PCPSWebInput webInput,
			String Pername, String CardNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return saleOrderRealNameDetailDaoImpl.getPersonalCustomCardDatil(
				webInput, Pername, CardNo);
	}

	/**
	 * 持卡人消费情况表
	 * 
	 * @return List<Object[]>
	 */
	@EJB(mappedName = "transaction.impl.MchAccDetailDaoImpl")
	private MchAccDetailDao mchAccDetailDaoImpl;

	public List<Object[]> getMchAccDetailAll(PCPSWebInput webInput,
			String startDate, String endDate, BigInteger amount) {

		commonDaoImpl.setSysLogPath(webInput);
		return mchAccDetailDaoImpl.getMchAccDetailAll(webInput, startDate,
				endDate, amount);
	}

	/**
	 * 持卡人账户报表
	 * 
	 * @param webInput
	 * @return
	 */
	public List<Object[]> getActivatecardByOwnerAll(PCPSWebInput webInput) {

		commonDaoImpl.setSysLogPath(webInput);
		return activateCardDaoImpl.getActivatecardByOwnerAll(webInput);
	}

	/**
	 * 西邮寄卡残值明细表
	 * 
	 * @param webInput
	 * @param saleBranchNo
	 * @param balanceUpperLimit
	 * @return
	 */
	public List<Object[]> getActivateCardsResidualDetail(PCPSWebInput webInput,
			String isSingle, String saleBranchNo, BigInteger balanceUpperLimit) {

		commonDaoImpl.setSysLogPath(webInput);
		return activateCardDaoImpl.getActivateCardsResidualDetail(isSingle,
				saleBranchNo, balanceUpperLimit);
	}

	/**
	 * 西邮寄卡残值明细表
	 * 
	 * @param webInput
	 * @param saleBranchNo
	 * @param balanceUpperLimit
	 * @return
	 */
	public List<Object[]> getActivateCardsResidualStatistics(
			PCPSWebInput webInput, String isSingle, String saleBranchNo,
			BigInteger balanceUpperLimit) {

		commonDaoImpl.setSysLogPath(webInput);
		return activateCardDaoImpl.getActivateCardsResidualStatistics(isSingle,
				saleBranchNo, balanceUpperLimit);
	}

	/**
	 * 账户管理费收入明细表
	 * 
	 * @param webInput
	 * @param saleBranchNo
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public List<Object[]> getCardAccountManagementFeeDetail(
			PCPSWebInput webInput, String isSingle, String saleBranchNo,
			Date startDate, Date endDate) {

		commonDaoImpl.setSysLogPath(webInput);
		return activateCardDaoImpl.getCardAccountManagementFeeDetail(isSingle,
				saleBranchNo, startDate, endDate);
	}

	/**
	 * 账户管理费收入统计表
	 * 
	 * @param webInput
	 * @param saleBranchNo
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public List<Object[]> getCardAccountManagementFeeStatistics(
			PCPSWebInput webInput, String isSingle, String saleBranchNo,
			Date startDate, Date endDate) {

		commonDaoImpl.setSysLogPath(webInput);
		return activateCardDaoImpl.getCardAccountManagementFeeStatistics(
				isSingle, saleBranchNo, startDate, endDate);
	}

	/**
	 * 根据要素检索西邮寄卡商户渠道充值明细表
	 * 
	 * @param MerchantNo
	 *            商户号
	 * @param MerchantBranchNo
	 *            商户分支机构号
	 * @param startDate
	 *            起始日期
	 * @param endTime
	 *            终止日期
	 * @return 商户渠道充值明细对象列表
	 * 
	 */
	public List<Object[]> getMchHisTradDetailRechargeList(
			PCPSWebInput webInput, String startDate, String endDate,
			String MerchantNo, String MerchantBranchNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return mchHisTradDetailDaoImpl.getMchHisTradDetailRechargeList(
				webInput, startDate, endDate, MerchantNo, MerchantBranchNo);
	}

	/**
	 * 根据要素检索西邮寄卡商户渠道充值统计表
	 * 
	 * @param MerchantNo
	 *            商户号
	 * @param startDate
	 *            起始日期
	 * @param endTime
	 *            终止日期
	 * @return 商户渠道充值统计对象列表
	 * 
	 */
	public List<Object[]> getMchHisTradDetailRechargeTotal(
			PCPSWebInput webInput, String startDate, String endDate,
			String MerchantNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return mchHisTradDetailDaoImpl.getMchHisTradDetailRechargeTotal(
				webInput, startDate, endDate, MerchantNo);
	}

	/**
	 * 根据要素检索渠道交易充值轧差表
	 * 
	 * @param MerchantNo
	 *            商户号
	 * @param startDate
	 *            起始日期
	 * @param endTime
	 *            终止日期
	 * @return 渠道交易充值轧差列表
	 * 
	 */
	public List<Object[]> getMchHisTradDetailAccount(PCPSWebInput webInput,
			String startDate, String endDate, String MerchantNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return mchHisTradDetailDaoImpl.getMchHisTradDetailAccount(webInput,
				startDate, endDate, MerchantNo);
	}

	/**
	 * 根据西邮寄分公司渠道交易汇总表--报表
	 * 
	 * @param merchantno
	 *            商户号
	 * @param startTime
	 *            起始日期
	 * @param endTime
	 *            终止日期
	 * @return 西邮寄分公司渠道交易汇总表对象列表
	 * 
	 */
	public List<Object[]> getMerchantDaySettlementByMerchant(
			PCPSWebInput webInput, String merchantno, String startTime,
			String endTime) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantDaySettlementDaoImpl.getMerchantDaySettlementByMerchant(
				webInput, merchantno, startTime, endTime);
	}

	/**
	 * 根据西邮寄卡交易结算汇总表--报表
	 * 
	 * @param merchantno
	 *            商户号
	 * @param startTime
	 *            起始日期
	 * @param endTime
	 *            终止日期
	 * @return 西邮寄卡交易结算汇总表对象列表 *
	 */
	public List<Object[]> getMerchantDaySettlementSettleAccountsByMerchant(
			PCPSWebInput webInput, String merchantno, String startTime,
			String endTime) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantDaySettlementDaoImpl
				.getMerchantDaySettlementSettleAccountsByMerchant(webInput,
						merchantno, startTime, endTime);
	}

	// 收益按日汇总表
	@EJB(mappedName = "report.impl.IncomeDaySettlementDaoImpl")
	private IncomeDaySettlementDao incomeDaySettlementDaoImpl;

	/**
	 * 分公司渠道消费汇总表
	 * 
	 * @param incomeBranchID
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public List<Object[]> getIncomeSettlementConsume(String brchNo,
			String startDate, String endDate) {
		return incomeDaySettlementDaoImpl.getIncomeSettlementConsumeData(
				brchNo, startDate, endDate);
	}

	/**
	 * 渠道收入统计表(内容)---报表
	 * 
	 * @param startDate
	 *            起始日期
	 * @param endDate
	 *            终止日期
	 * @param return
	 *            渠道收入统计表数组对象
	 */
	public List<Object[]> getIncomeDaySettlementTotalAll(PCPSWebInput webInput,
			String branchNoCond, String startDate, String endDate) {

		commonDaoImpl.setSysLogPath(webInput);
		return incomeDaySettlementDaoImpl.getIncomeDaySettlementTotalAll(
				webInput, branchNoCond, startDate, endDate);
	}

	/**
	 * 渠道收入汇总表(内容)---报表
	 * 
	 * @param startDate
	 *            起始日期
	 * @param endDate
	 *            终止日期
	 * @param return
	 *            渠道收入汇总表数组对象
	 */
	public List<Object[]> getIncomeDaySettlementCountAll(PCPSWebInput webInput,
			String branchNoCond, String startDate, String endDate) {

		commonDaoImpl.setSysLogPath(webInput);
		return incomeDaySettlementDaoImpl.getIncomeDaySettlementCountAll(
				webInput, branchNoCond, startDate, endDate);
	}

	/**
	 * 渠道收入汇总表(表头)-----报表
	 * 
	 * @param startDate
	 *            起始日期
	 * @param endDate
	 *            终止日期
	 * @param return
	 *            渠道收入汇总表数组对象
	 */
	public List<Object[]> getIncomeDaySettlementTotalAllTitle(
			PCPSWebInput webInput, String branchNoCond, String startDate,
			String endDate) {

		commonDaoImpl.setSysLogPath(webInput);
		return incomeDaySettlementDaoImpl.getIncomeDaySettlementTotalAllTitle(
				webInput, branchNoCond, startDate, endDate);
	}

	/**
	 * 渠道收入统计表(内容)---报表
	 * 
	 * @param issueCompanyNo
	 *            发卡商编号
	 * @param saleBranchBno
	 *            销售机构号
	 * @param startDate
	 *            起始日期
	 * @param endDate
	 *            终止日期
	 * @param return
	 *            渠道收入汇总表数组对象
	 */
	public List<Object[]> getIncomeDaySettlementTotalBySaleBranchno(
			PCPSWebInput webInput, String branchNoCond, String startDate,
			String endDate) {

		commonDaoImpl.setSysLogPath(webInput);
		return incomeDaySettlementDaoImpl
				.getIncomeDaySettlementTotalBySaleBranchno(webInput,
						branchNoCond, startDate, endDate);
	}

	/**
	 * 渠道收入统计表(表头)-----报表
	 * 
	 * @param issueCompanyNo
	 *            发卡商编号
	 * @param saleBranchBno
	 *            销售机构号
	 * @param startDate
	 *            起始日期
	 * @param endDate
	 *            终止日期
	 * @param return
	 *            渠道收入汇总表数组对象
	 */
	public List<Object[]> getIncomeDaySettlementTotalBySaleBranchnoTitle(
			PCPSWebInput webInput, String branchNoCond, String startDate,
			String endDate) {

		commonDaoImpl.setSysLogPath(webInput);
		return incomeDaySettlementDaoImpl
				.getIncomeDaySettlementTotalBySaleBranchnoTitle(webInput,
						branchNoCond, startDate, endDate);
	}

	/**
	 * 各渠道开发单位交易额汇总表
	 * 
	 * @param webInput
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public List<Object[]> getEachUnitVolumeTransactionsSummary(
			PCPSWebInput webInput, String startDate, String endDate) {

		commonDaoImpl.setSysLogPath(webInput);
		return incomeDaySettlementDaoImpl.getEachUnitVolumeTransactionsSummary(
				webInput, startDate, endDate);
	}

	@EJB(mappedName = "report.impl.SaleCapitalDaySettlementDaoImpl")
	private SaleCapitalDaySettlementDao saleCapitalDaySettlementDaoImpl;

	/**
	 * 预付款结余统计表
	 * 
	 * @param webInput
	 * @param startTranDate
	 * @param endTranDate
	 * @return
	 */
	public List<Object[]> getPrepaymentBalanceReport(PCPSWebInput webInput,
			String startTranDate, String endTranDate) {

		commonDaoImpl.setSysLogPath(webInput);
		return saleCapitalDaySettlementDaoImpl.getPrepaymentBalanceReport(
				webInput, startTranDate, endTranDate);
	}

	/**
	 * 根据商户号查询商户分支机构
	 * 
	 * @param merchantNo
	 *            商户号
	 * @return List 商户分支机构列表
	 */
	public List<Object[]> getMerchantBranchByMerchantNo(PCPSWebInput webInput,
			String merchantNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantBranchDaoImpl.getMerchantBranchByMerchantNo(merchantNo);
	}

	/**
	 * 省内地市局准备金余额变动表
	 * 
	 * @param webInput
	 * @param startTranDate
	 * @param endTranDate
	 * @return
	 */
	public List<Object[]> getRegionReserveBalanceChangeReport(
			PCPSWebInput webInput, String startTranDate, String endTranDate) {

		commonDaoImpl.setSysLogPath(webInput);
		return saleCapitalDaySettlementDaoImpl
				.getRegionReserveBalanceChangeReport(webInput, startTranDate,
						endTranDate);
	}

	/**
	 * 西邮寄卡交易明细
	 * 
	 * @param webInput
	 * @param startTranDate
	 * @param endTranDate
	 * @param cardNo
	 * @return
	 */
	public List<Object[]> getMchCardsTranReport(PCPSWebInput webInput,
			String startTranDate, String endTranDate, String cardNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return mchHisTradDetailDaoImpl.getMchCardsTranReport(webInput,
				startTranDate, endTranDate, cardNo);
	}

	// 凭证种类表
	@EJB(mappedName = "organization.impl.VoucherBusinessImpl")
	private VoucherBusiness voucherBusinessImpl;
	@EJB(mappedName = "organization.impl.VoucherDaoImpl")
	private VoucherDao voucherDaoImpl;

	/**
	 * 根据凭证名称查询凭证种类列表---注：模糊查询
	 * 
	 * @param voucherName
	 *            凭证名称
	 * @param page
	 *            页码
	 * @return 凭证种类列表
	 */
	public List<Voucher> getVoucherListByVoucherName(PCPSWebInput webInput,
			String voucherName, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherDaoImpl.getVoucherDropListByVoucherName(webInput,
				voucherName);
	}

	/**
	 * 查询销售商记录条数
	 * 
	 * @param branchNo
	 *            所属机构
	 * @return BigInteger 记录总数
	 */
	public BigInteger getVoucherListByVoucherNameTotal(PCPSWebInput webInput,
			String voucherName) {
		return voucherDaoImpl.getVoucherListByVoucherNameTotal(webInput,
				voucherName);
	}

	/**
	 * 根据凭证id查询凭证种类对象
	 * 
	 * @param voucherId
	 *            凭证Id
	 * @return 凭证种类对象
	 */
	public Voucher getVoucherByVoucherId(BigInteger voucherId) {
		return voucherDaoImpl.getVoucherByVoucherId(voucherId);
	}

	/**
	 * 根据凭证名称查询凭证种类列表---注：模糊查询(用于下拉或弹出)
	 * 
	 * @param voucherName
	 *            凭证名称
	 * @return 凭证种类列表
	 */
	public List<Voucher> getVoucherDropListByVoucherName(PCPSWebInput webInput,
			String voucherName) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherDaoImpl.getVoucherDropListByVoucherName(webInput,
				voucherName);
	}

	/**
	 * @删除凭证种类
	 * @param voucherName
	 * 凭证名称 @
	 */
	public CommonWebResult deleteVoucher(PCPSWebInput webInput,
			BigInteger voucherId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			voucherDaoImpl.deleteVoucher(voucherId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 新增凭证种类
	 * 
	 * @param Voucher
	 * 凭证种类 @
	 */
	public CommonWebResult insertVoucher(PCPSWebInput webInput, Voucher voucher) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			voucherBusinessImpl.insertVoucher(webInput, voucher);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改凭证种类
	 * 
	 * @param Voucher
	 * 凭证种类 @
	 */
	public CommonWebResult updateVoucher(PCPSWebInput webInput, Voucher voucher) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			voucherBusinessImpl.updateVoucher(webInput, voucher);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 业务凭证种类对照
	@EJB(mappedName = "organization.impl.VoucherBusinessBindBusinessImpl")
	private VoucherBusinessBindBusiness voucherBusinessBindBusinessImpl;
	@EJB(mappedName = "organization.impl.VoucherBusinessBindDaoImpl")
	private VoucherBusinessBindDao voucherBusinessBindImpl;

	/**
	 * 根据业务类型检索业务凭证种类对照列表---注：模糊查询
	 * 
	 * @param businessType
	 *            业务类型
	 * @param page
	 *            页码
	 * @return 对照列表
	 */
	public List<VoucherBusinessBind> getVoucherBusinessBindByBusinessType(
			PCPSWebInput webInput, String businessType, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherBusinessBindImpl.getVoucherBusinessBindByBusinessType(
				webInput, businessType, page);
	}

	/**
	 * 查询业务凭证种类对照记录条数
	 * 
	 * @param businessType
	 *            业务类型
	 * @return BigInteger 记录总数
	 */
	public BigInteger getVoucherBusinessBindByBusinessTypeTotal(
			PCPSWebInput webInput, String businessType) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherBusinessBindImpl
				.getVoucherBusinessBindByBusinessTypeTotal(webInput,
						businessType);
	}

	/**
	 * 根据凭证id和业务类型查询业务凭证种类对照对象
	 * 
	 * @param voucherId
	 *            凭证Id
	 * @param businessType
	 *            业务类型
	 * @return 对照对象
	 */
	public VoucherBusinessBind getVoucherBusinessBind(PCPSWebInput webInput,
			BigInteger voucherId, String businessType) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherBusinessBindImpl.getVoucherBusinessBind(voucherId,
				businessType);
	}

	/**
	 * 新增业务凭证种类对照
	 * 
	 * @param VoucherBusinessBind
	 * 业务凭证种类对照 @
	 */
	public CommonWebResult insertVoucherBusinessBind(PCPSWebInput webInput,
			VoucherBusinessBind voucherbusinessbind) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			voucherBusinessBindBusinessImpl.insertVoucherBusinessBind(webInput,
					voucherbusinessbind);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * @删除业务凭证种类对照
	 * @param VoucherBusinessBind
	 * 业务凭证种类对照 @
	 */
	public CommonWebResult deleteVoucherBusinessBind(PCPSWebInput webInput,
			VoucherBusinessBind voucherbusinessbind) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			voucherBusinessBindImpl
					.deleteVoucherBusinessBind(voucherbusinessbind);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	@EJB(mappedName = "antimoney.impl.SuspiciousReportDaoImpl")
	private SuspiciousReportDao suspiciousReportDaoImpl;

	/**
	 * 修改上报状态
	 * 
	 * @param sr @
	 */
	public CommonWebResult updateSuspiciousReport(PCPSWebInput webInput,
			SuspiciousReport sr) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			suspiciousReportDaoImpl.updateSuspiciousReport(sr);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据条件查询可疑交易报告表清单
	 * 
	 * @param startdate
	 *            起始时间
	 * @param senddate
	 *            终止时间
	 * @param reportstatus
	 *            报告状态
	 * @param orxn
	 *            报告名称
	 */
	public List<SuspiciousReport> getSuspiciousReportByCondition(
			PCPSWebInput webInput, String startdate, String enddate,
			String reportstatus, String orxn, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return suspiciousReportDaoImpl.getSuspiciousReportByCondition(webInput,
				startdate, enddate, reportstatus, orxn, page);
	}

	/**
	 * 根据条件查询可疑交易报告表清单总数
	 * 
	 * @param startdate
	 *            起始时间
	 * @param senddate
	 *            终止时间
	 * @param reportstatus
	 *            报告状态
	 * @param orxn
	 *            报告名称
	 */
	public BigInteger getSuspiciousReportByConditionTotal(
			PCPSWebInput webInput, String startdate, String enddate,
			String reportstatus, String orxn) {

		commonDaoImpl.setSysLogPath(webInput);
		return suspiciousReportDaoImpl.getSuspiciousReportByConditionTotal(
				webInput, startdate, enddate, reportstatus, orxn);
	}

	/**
	 * 根据主键查询
	 * 
	 * @param id
	 * @return @
	 */
	public SuspiciousReport getSuspiciousReportById(PCPSWebInput webInput,
			BigInteger id) {
		return suspiciousReportDaoImpl.getSuspiciousReportById(id);
	}

	@EJB(mappedName = "antimoney.impl.AlarmRuleDaoImpl")
	private AlarmRuleDao alarmRuleDaoImpl;
	@EJB(mappedName = "antimoney.impl.AlarmRuleBusinessImpl")
	private AlarmRuleBusiness alarmRuleBusinessImpl;

	/**
	 * 预警规则插入
	 * 
	 * @param ar
	 * 预警规则 @ 异常信息
	 */
	public CommonWebResult insertAlarmRule(PCPSWebInput webInput, AlarmRule ar) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			alarmRuleBusinessImpl.insert(webInput, ar);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 预警规则修改
	 * 
	 * @param ar
	 * 预警规则 @ 异常信息
	 */
	public CommonWebResult updateAlarmRule(PCPSWebInput webInput, AlarmRule ar) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			alarmRuleBusinessImpl.update(webInput, ar);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据主键查询预警规则
	 * 
	 * @param id
	 * @return @
	 */
	public AlarmRule getAlarmRuleById(PCPSWebInput webInput, BigInteger id) {
		return alarmRuleDaoImpl.getAlarmRuleById(id);
	}

	/**
	 * 查询指定发卡商定义的预警规则
	 * 
	 * @param issueCompanyNo
	 * @return
	 */
	public List<AlarmRule> getAllAlarmRuleByIssueCompanyNo(
			PCPSWebInput webInput, String issueCompanyNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return alarmRuleDaoImpl.getAllAlarmRuleByIssueCompanyNo(issueCompanyNo);
	}

	/**
	 * 条件查询预警规则
	 * 
	 * @param issueCompanyNo
	 *            发卡商编号
	 * @param alarmruletype
	 *            规则类型
	 * @param status
	 *            状态
	 * @param alarmRuleDesc
	 *            规则描述
	 * @param pageNo
	 *            页码
	 * @return
	 */
	public List<AlarmRule> getAlarmRuleByCondition(PCPSWebInput webInput,
			String alarmruletype, String status, String alarmRuleDesc,
			Integer pageNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return alarmRuleDaoImpl.getAlarmRuleByCondition(webInput,
				alarmruletype, status, alarmRuleDesc, pageNo);
	}

	/**
	 * 条件查询预警规则总数
	 * 
	 * @param issueCompanyNo
	 *            发卡商编号
	 * @param alarmruletype
	 *            规则类型
	 * @param status
	 *            状态
	 * @param alarmRuleDesc
	 *            规则描述
	 * @return
	 */
	public Integer getAlarmRuleCountByCondition(PCPSWebInput webInput,
			String alarmruletype, String status, String alarmRuleDesc) {
		return alarmRuleDaoImpl.getAlarmRuleCountByCondition(webInput,
				alarmruletype, status, alarmRuleDesc);
	}

	@EJB(mappedName = "antimoney.impl.AlarmInfoDaoImpl")
	private AlarmInfoDao alarmInfoDaoImpl;
	@EJB(mappedName = "antimoney.impl.AlarmInfoBusinessImpl")
	private AlarmInfoBusiness alarmInfoBusinessImpl;

	/**
	 * 预警信息处理
	 * 
	 * @param alarmInfo
	 * 预警信息 @ 异常信息
	 */
	public CommonWebResult dealAlarmInfo(PCPSWebInput webInput,
			AlarmInfo alarmInfo) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			alarmInfoBusinessImpl.dealAlarmInfo(webInput, alarmInfo);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据主键查询预警信息
	 * 
	 * @param id
	 * @return @
	 */
	public AlarmInfo getAlarmInfoById(PCPSWebInput webInput,
			BigInteger alarmInfoId) {
		return alarmInfoDaoImpl.getAlarmInfoById(alarmInfoId);
	}

	/**
	 * 根据指定发卡商查询预警信息
	 * 
	 * @param issueCompanyNo
	 * @return
	 */
	public List<AlarmInfo> getAllAlarmInfoByIssueCompanyNo(
			PCPSWebInput webInput, String issceCompanyNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return alarmInfoDaoImpl.getAllAlarmInfoByIssueCompanyNo(issceCompanyNo);
	}

	/**
	 * 条件查询预警信息
	 * 
	 * @param issueCompanyNo
	 *            发卡商编号
	 * @param startAlarmTime
	 *            起始预警时间
	 * @param endAlarmTime
	 *            终止预警时间
	 * @param dealStatus
	 *            处理状态
	 * @param pageNo
	 *            页码
	 * @return
	 */
	public List<AlarmInfo> getAlarmInfoByCondition(PCPSWebInput webInput,
			String startAlarmTime, String endAlarmTime, String dealStatus,
			Integer pageNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return alarmInfoDaoImpl.getAlarmInfoByCondition(webInput,
				startAlarmTime, endAlarmTime, dealStatus, pageNo);
	}

	/**
	 * 条件查询预警信息总数
	 * 
	 * @param issueCompanyNo
	 *            发卡商编号
	 * @param startAlarmTime
	 *            起始预警时间
	 * @param endAlarmTime
	 *            终止预警时间
	 * @param dealStatus
	 *            处理状态
	 * @return
	 */
	public Integer getAlarmInfoCountByCondition(PCPSWebInput webInput,
			String startAlarmTime, String endAlarmTime, String dealStatus) {
		return alarmInfoDaoImpl.getAlarmInfoCountByCondition(webInput,
				startAlarmTime, endAlarmTime, dealStatus);
	}

	/**
	 * 可疑交易批量上报选择列表
	 * 
	 * @param webInput
	 * @param alarmRuleId
	 * @param startAlarmTime
	 * @param endAlarmTime
	 * @param page
	 * @return
	 */
	public List<AlarmInfo> getAlarmInfoReportListByCondition(
			PCPSWebInput webInput, BigInteger alarmRuleId,
			String startAlarmTime, String endAlarmTime, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return alarmInfoDaoImpl.getAlarmInfoReportListByCondition(webInput,
				alarmRuleId, startAlarmTime, endAlarmTime, page);
	}

	/**
	 * 可疑交易批量上报选择列表数目
	 * 
	 * @param webInput
	 * @param alarmRuleId
	 * @param startAlarmTime
	 * @param endAlarmTime
	 * @return
	 */
	public Integer getAlarmInfoReportTotalByCondition(PCPSWebInput webInput,
			BigInteger alarmRuleId, String startAlarmTime, String endAlarmTime) {

		commonDaoImpl.setSysLogPath(webInput);
		return alarmInfoDaoImpl.getAlarmInfoReportTotalByCondition(webInput,
				alarmRuleId, startAlarmTime, endAlarmTime);
	}

	/**
	 * 可疑交易报表--报表
	 * 
	 * @param webInput
	 * @param branchno
	 *            预警机构
	 * @param startTranTime
	 *            交易起始时间
	 * @param endTranTime
	 *            交易终止时间
	 * @return list对象
	 */
	public List<Object[]> getSuspiciousReportList(PCPSWebInput webInput,
			Date startTranTime, Date endTranTime) {

		commonDaoImpl.setSysLogPath(webInput);
		return alarmInfoDaoImpl.getSuspiciousReportList(webInput,
				startTranTime, endTranTime);
	}

	/**
	 * 日常可疑交易报表--报表
	 * 
	 * @param webInput
	 * @param branchno
	 *            预警机构
	 * @param startTranTime
	 *            交易起始时间
	 * @param endTranTime
	 *            交易终止时间
	 * @return list对象
	 */
	public List<Object[]> getSuspiciousReportDayList(PCPSWebInput webInput,
			Date startTranTime, Date endTranTime) {

		commonDaoImpl.setSysLogPath(webInput);
		return alarmInfoDaoImpl.getSuspiciousReportDayList(webInput,
				startTranTime, endTranTime);
	}

	@EJB(mappedName = "antimoney.impl.AlarmInfoDetailDaoImpl")
	private AlarmInfoDetailDao alarmInfoDetailDaoImpl;

	/**
	 * 根据预警信息Id查询预警明细列表
	 * 
	 * @param alarmInfoId
	 * @return
	 */
	public List<AlarmInfoDetail> getAlarmInfoDetailsByAlarmInfoId(
			PCPSWebInput webInput, BigInteger alarmInfoId, Integer pageNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return alarmInfoDetailDaoImpl.getAlarmInfoDetailsByAlarmInfoId(
				alarmInfoId, pageNo);
	}

	/**
	 * 根据预警信息Id查询预警明细总数
	 * 
	 * @param alarmInfoId
	 * @return
	 */
	public Integer getAlarmInfoDetailsCountByAlarmInfoId(BigInteger alarmInfoId) {
		return alarmInfoDetailDaoImpl
				.getAlarmInfoDetailsCountByAlarmInfoId(alarmInfoId);
	}

	@EJB(mappedName = "antimoney.impl.SuspiciousTransBusinessImpl")
	private SuspiciousTransBusiness suspiciousTransBusinessImpl;
	@EJB(mappedName = "antimoney.impl.SuspiciousTransDaoImpl")
	private SuspiciousTransDao suspiciousTransDaoImpl;

	/**
	 * 修改可疑交易明细
	 * 
	 * @param suspiciousTrans @
	 */
	public CommonWebResult updateSuspiciousTrans(PCPSWebInput webInput,
			SuspiciousTrans suspiciousTrans) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			suspiciousTransBusinessImpl.updateSuspiciousTrans(webInput,
					suspiciousTrans);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 条件查询可疑交易明细
	 * 
	 * @param webInput
	 * @param alarmRuleType预警规则类型
	 * @param startAlarmTime起始预警时间
	 * @param endAlarmTime终止预警时间
	 * @param reportStats上报状态
	 * @param startReportTime起始上报时间
	 * @param endReportTime终止上报时间
	 * @param suspiciousName可疑主体名称
	 * @param suspiciousId可疑主体证件号
	 * @param startAmount起始金额
	 * @param endAmount终止金额
	 * @param page页号
	 * @return
	 */
	public List<Object[]> getSuspiciousTransByCondition(PCPSWebInput webInput,
			String alarmRuleType, String startAlarmTime, String endAlarmTime,
			String reportStats, String startReportTime, String endReportTime,
			String suspiciousName, String suspiciousId, BigInteger startAmount,
			BigInteger endAmount, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return suspiciousTransDaoImpl.getSuspiciousTransByCondition(webInput,
				alarmRuleType, startAlarmTime, endAlarmTime, reportStats,
				startReportTime, endReportTime, suspiciousName, suspiciousId,
				startAmount, endAmount, page);

	}

	/**
	 * 条件查询可疑交易明细总数
	 * 
	 * @param webInput
	 * @param alarmRuleType预警规则类型
	 * @param startAlarmTime起始预警时间
	 * @param endAlarmTime终止预警时间
	 * @param reportStats上报状态
	 * @param startReportTime起始上报时间
	 * @param endReportTime终止上报时间
	 * @param suspiciousName可疑主体名称
	 * @param suspiciousId可疑主体证件号
	 * @param startAmount起始金额
	 * @param endAmount终止金额
	 * @return
	 */
	public Integer getSuspiciousTransCountByCondition(PCPSWebInput webInput,
			String alarmRuleType, String startAlarmTime, String endAlarmTime,
			String reportStats, String startReportTime, String endReportTime,
			String suspiciousName, String suspiciousId, BigInteger startAmount,
			BigInteger endAmount) {
		return suspiciousTransDaoImpl.getSuspiciousTransCountByCondition(
				webInput, alarmRuleType, startAlarmTime, endAlarmTime,
				reportStats, startReportTime, endReportTime, suspiciousName,
				suspiciousId, startAmount, endAmount);
	}

	/**
	 * 根据主键查询可疑交易明细
	 * 
	 * @param webInput
	 * @param suspiciousTrans
	 * @return
	 */
	public SuspiciousTrans getSuspiciousTransById(
			SuspiciousTrans suspiciousTrans) {
		return suspiciousTransDaoImpl.getSuspiciousTransById(suspiciousTrans);
	}

	/**
	 * 删除可以交易明细
	 * 
	 * @param suspiciousTrans @
	 */
	public CommonWebResult deleteSuspiciousTrans(PCPSWebInput webInput,
			SuspiciousTrans suspiciousTrans) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			suspiciousTransBusinessImpl.deleteSuspiciousTrans(webInput,
					suspiciousTrans);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	@EJB(mappedName = "antimoney.impl.SuspiciousReportBusinessImpl")
	private SuspiciousReportBusiness suspiciousReportBusinessImpl;

	public CommonWebResult createSuspiciousReport(PCPSWebInput webInput,
			List<BigInteger> alarmInfoIds, SuspiciousReport sr) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			suspiciousReportBusinessImpl.createSuspiciousReport(webInput,
					alarmInfoIds, sr);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 重新上报可疑交易报告信息
	 * 
	 * @param reoprtid @
	 */
	public CommonWebResult supplySuspiciousReport(PCPSWebInput webInput,
			BigInteger reoportid) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			suspiciousReportBusinessImpl.supplySuspiciousReport(webInput,
					reoportid);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	@EJB(mappedName = "organization.impl.MerchantFeePolicyDaoImpl")
	private MerchantFeePolicyDao mrchFeePolicyDaoImpl;
	@EJB(mappedName = "organization.impl.MerchantFeePolicyBusinessImpl")
	private MerchantFeePolicyBusiness mrchFeePolicyBusImpl;

	/**
	 * 新增持卡人商户交易资费策略
	 * 
	 * @param webInput
	 * @param mfp @
	 */
	public CommonWebResult insertMerchantFeePolicy(PCPSWebInput webInput,
			MerchantFeePolicy mfp) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			mrchFeePolicyBusImpl.insertMerchantFeePolicy(webInput, mfp);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改持卡人商户交易资费策略
	 * 
	 * @param webInput
	 * @param mfp @
	 */
	public CommonWebResult updateMerchantFeePolicy(PCPSWebInput webInput,
			MerchantFeePolicy mfp) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			mrchFeePolicyBusImpl.updateMerchantFeePolicy(webInput, mfp);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 删除持卡人商户交易资费策略,只有状态为(3生效待审核)的可删除
	 * 
	 * @param webInput
	 * @param mrchFeePolicyId
	 * @return @
	 */
	public CommonWebResult deleteMerchantFeePolicy(PCPSWebInput webInput,
			BigInteger mrchFeePolicyId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			mrchFeePolicyBusImpl.deleteMerchantFeePolicy(webInput,
					mrchFeePolicyId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 审核持卡人商户交易资费策略 通过
	 * 
	 * @param webInput
	 * @param mrchFeePolicyId
	 * @return @
	 */
	public CommonWebResult authMerchantFeePolicy(PCPSWebInput webInput,
			BigInteger mrchFeePolicyId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			mrchFeePolicyBusImpl.authMerchantFeePolicy(webInput,
					mrchFeePolicyId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 审核持卡人商户交易资费策略 拒绝
	 * 
	 * @param webInput
	 * @param mrchFeePolicyId
	 * @return @
	 */
	public CommonWebResult unAuthMerchantFeePolicy(PCPSWebInput webInput,
			BigInteger mrchFeePolicyId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			mrchFeePolicyBusImpl.unAuthMerchantFeePolicy(webInput,
					mrchFeePolicyId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 设置持卡人商户交易资费策略 为无效待审核
	 * 
	 * @param webInput
	 * @param mrchFeePolicyId
	 * @return @
	 */
	public CommonWebResult closeMerchantFeePolicy(PCPSWebInput webInput,
			BigInteger mrchFeePolicyId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			mrchFeePolicyBusImpl.closeMerchantFeePolicy(webInput,
					mrchFeePolicyId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据资费策略id获取信息
	 * 
	 * @param mfpid
	 * @return
	 */
	public MerchantFeePolicy getMerchantFeePolicyByPolicyId(BigInteger mfpid) {
		return mrchFeePolicyDaoImpl.getMerchantFeePolicyByPolicyId(mfpid);
	}

	/**
	 * 根据条件查询 持卡人商户交易资费策略分页数据 列表
	 * 
	 * @param merchantNo
	 * @param businessType
	 * @param cardFaceId
	 * @param cardClassicId
	 * @param feeType
	 * @param status
	 * @param page
	 * @return
	 */
	public List<MerchantFeePolicy> getMrchFeePolicyByConditions(
			PCPSWebInput webInput, String merchantNo, String businessType,
			String cardFaceId, String cardClassicId, String feeType,
			String status, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return mrchFeePolicyDaoImpl.getMrchFeePolicyByConditions(webInput,
				merchantNo, businessType, cardFaceId, cardClassicId, feeType,
				status, page);
	}

	/**
	 * 根据条件查询 持卡人商户交易资费策略分页数据 总数
	 * 
	 * @param merchantNo
	 * @param businessType
	 * @param cardFaceId
	 * @param cardClassicId
	 * @param feeType
	 * @param status
	 * @return
	 */
	public BigInteger getMrchFeePolicyTotalByConditions(PCPSWebInput webInput,
			String merchantNo, String businessType, String cardFaceId,
			String cardClassicId, String feeType, String status) {
		return mrchFeePolicyDaoImpl.getMrchFeePolicyTotalByConditions(webInput,
				merchantNo, businessType, cardFaceId, cardClassicId, feeType,
				status);
	}

	// 凭证调拨单迁移明细
	@EJB(mappedName = "organization.impl.VoucherOrderActionDetailDaoImpl")
	private VoucherOrderActionDetailDao voucherOrderActionDetailDaoImpl;

	/**
	 * 根据条件查询迁移列表
	 * 
	 * @param id
	 *            调入机构号
	 * @return 凭证调拨单状态表列表
	 */
	public List<VoucherOrderActionDetail> getVoucherOrderActionDetailList(
			PCPSWebInput webInput, BigInteger transferOrderId) {
		commonDaoImpl.setSysLogPath(webInput);
		return voucherOrderActionDetailDaoImpl
				.getVoucherOrderActionDetailList(transferOrderId);
	}

	// 凭证调拨单
	@EJB(mappedName = "organization.impl.VoucherTransferOrderDaoImpl")
	private VoucherTransferOrderDao voucherTransferOrderDaoImpl;
	@EJB(mappedName = "organization.impl.VoucherTransferOrderBusinessImpl")
	private VoucherTransferOrderBusiness voucherTransferOrderBusinessImpl;

	/**
	 * 根据条件查询凭证调拨单列表
	 * 
	 * @param toBranchNo
	 *            调入机构号
	 * @param status
	 *            状态
	 * @param startDate
	 *            起始时间
	 * @param endDate
	 *            终止时间
	 * @param page
	 *            页码
	 * @return 凭证入库单明细列表
	 */
	public List<VoucherTransferOrder> getVoucherTransferOrderList(
			PCPSWebInput webInput, String toBranchNo, String startDate,
			String endDate, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherTransferOrderDaoImpl.getVoucherTransferOrderList(
				webInput, toBranchNo, startDate, endDate, page);
	}

	/**
	 * 根据条件查询凭证调拨单记录数
	 * 
	 * @param toBranchNo
	 *            调入机构号
	 * @param status
	 *            状态
	 * @param startDate
	 *            起始时间
	 * @param endDate
	 *            终止时间
	 * @return 凭证调拨单记录数
	 */
	public Integer getVoucherTransferOrderListTotal(PCPSWebInput webInput,
			String toBranchNo, String startDate, String endDate) {
		return voucherTransferOrderDaoImpl.getVoucherTransferOrderListTotal(
				webInput, toBranchNo, startDate, endDate);
	}

	/**
	 * 根据条件查询凭证调拨单列表--接收
	 * 
	 * @param toBranchNo
	 *            调入机构号
	 * @param status
	 *            状态
	 * @param startDate
	 *            起始时间
	 * @param endDate
	 *            终止时间
	 * @param page
	 *            页码
	 * @return 凭证入库单明细列表
	 */
	public List<VoucherTransferOrder> getVoucherTransferOrderListByReceive(
			PCPSWebInput webInput, String formBranchNo, String startDate,
			String endDate, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherTransferOrderDaoImpl
				.getVoucherTransferOrderListByReceive(webInput, formBranchNo,
						startDate, endDate, page);
	}

	/**
	 * 根据条件查询凭证调拨单记录数--接收
	 * 
	 * @param toBranchNo
	 *            调入机构号
	 * @param status
	 *            状态
	 * @param startDate
	 *            起始时间
	 * @param endDate
	 *            终止时间
	 * @return 凭证调拨单记录数
	 */
	public Integer getVoucherTransferOrderListTotalByReceive(
			PCPSWebInput webInput, String formBranchNo, String startDate,
			String endDate) {
		return voucherTransferOrderDaoImpl
				.getVoucherTransferOrderListTotalByReceive(webInput,
						formBranchNo, startDate, endDate);
	}

	/**
	 * 根据条件查询凭证调拨单列表--接收确认
	 * 
	 * @param toBranchNo
	 *            调入机构号
	 * @param status
	 *            状态
	 * @param startDate
	 *            起始时间
	 * @param endDate
	 *            终止时间
	 * @param page
	 *            页码
	 * @return 凭证入库单明细列表
	 */
	public List<VoucherTransferOrder> getVoucherTransferOrderListByConfirm(
			PCPSWebInput webInput, String formBranchNo, String startDate,
			String endDate, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherTransferOrderDaoImpl
				.getVoucherTransferOrderListByConfirm(webInput, formBranchNo,
						startDate, endDate, page);
	}

	/**
	 * 根据条件查询凭证调拨单记录数--接收确认
	 * 
	 * @param toBranchNo
	 *            调入机构号
	 * @param status
	 *            状态
	 * @param startDate
	 *            起始时间
	 * @param endDate
	 *            终止时间
	 * @return 凭证调拨单记录数
	 */
	public Integer getVoucherTransferOrderListTotalByConfirm(
			PCPSWebInput webInput, String formBranchNo, String startDate,
			String endDate) {
		return voucherTransferOrderDaoImpl
				.getVoucherTransferOrderListTotalByConfirm(webInput,
						formBranchNo, startDate, endDate);
	}

	/**
	 * 根据条件查询凭证调拨单列表--调拨单查询
	 * 
	 * @param toBranchNo
	 *            调入机构号
	 * @param status
	 *            状态
	 * @param startDate
	 *            起始时间
	 * @param endDate
	 *            终止时间
	 * @param page
	 *            页码
	 * @return 凭证入库单明细列表
	 */
	public List<VoucherTransferOrder> getVoucherTransferOrderListByAll(
			PCPSWebInput webInput, String BranchNo, String status,
			String startDate, String endDate, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherTransferOrderDaoImpl.getVoucherTransferOrderListByAll(
				webInput, BranchNo, status, startDate, endDate, page);
	}

	/**
	 * 根据条件查询凭证调拨单记录数--调拨单查询
	 * 
	 * @param toBranchNo
	 *            调入机构号
	 * @param status
	 *            状态
	 * @param startDate
	 *            起始时间
	 * @param endDate
	 *            终止时间
	 * @return 凭证调拨单记录数
	 */
	public Integer getVoucherTransferOrderListTotalByAll(PCPSWebInput webInput,
			String BranchNo, String status, String startDate, String endDate) {
		return voucherTransferOrderDaoImpl
				.getVoucherTransferOrderListTotalByAll(webInput, BranchNo,
						status, startDate, endDate);
	}

	/**
	 * 根据id凭证调拨单对象
	 * 
	 * @param transferOrderId
	 * 凭证调拨单id @
	 */
	public VoucherTransferOrder getVoucherTransferOrderByTransferOrderId(
			BigInteger transferOrderId) {
		return voucherTransferOrderDaoImpl
				.getVoucherTransferOrderByTransferOrderId(transferOrderId);
	}

	/**
	 * 新增凭证调拨单
	 * 
	 * @param VoucherTransferOrder
	 * 凭证调拨单 @
	 */
	public CommonWebResult insertVoucherTransferOrder(PCPSWebInput webInput,
			VoucherTransferOrder voucherTransferOrder,
			List<VoucherTransferOrderDetail> datil) {

		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult commonWebResult = new CommonWebResult();
		commonWebResult.setSuccess(true);
		try {
			commonWebResult.setResult(voucherTransferOrderBusinessImpl
					.insertVoucherTransferOrder(webInput, voucherTransferOrder,
							datil).toString());
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return commonWebResult;
	}

	/**
	 * 修改凭证调拨单状态
	 * 
	 * @param VoucherTransferOrder
	 * 凭证调拨单 @
	 */
	public CommonWebResult updateVoucherTransferOrderByStatus(
			PCPSWebInput webInput, VoucherTransferOrder voucherTransferOrder) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			voucherTransferOrderBusinessImpl
					.updateVoucherTransferOrderByStatus(webInput,
							voucherTransferOrder);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改凭证调拨单状态--1-调出在途(M)--5-取消调出(M)
	 * 
	 * @param VoucherTransferOrder
	 * 凭证调拨单 @
	 */
	public CommonWebResult updateVoucherTransferOrderByStatusBy2(
			PCPSWebInput webInput, VoucherTransferOrder voucherTransferOrder) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			voucherTransferOrderBusinessImpl
					.updateVoucherTransferOrderByStatusBy2(webInput,
							voucherTransferOrder);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改凭证调拨单状态--3-接收确认(M)-4-拒收
	 * 
	 * @param VoucherTransferOrder
	 * 凭证调拨单 @
	 */
	public CommonWebResult updateVoucherTransferOrderByStatusBy3(
			PCPSWebInput webInput, VoucherTransferOrder voucherTransferOrder) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			voucherTransferOrderBusinessImpl
					.updateVoucherTransferOrderByStatusBy3(webInput,
							voucherTransferOrder);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 凭证调拨单详细
	@EJB(mappedName = "organization.impl.VoucherTransferOrderDetailDaoImpl")
	private VoucherTransferOrderDetailDao voucherTransferOrderDetailDaoImpl;

	/**
	 * 根据条件查询凭证调拨单明细列表
	 * 
	 * @param transferOrderId
	 *            调拨单ID
	 * @param page
	 *            页码
	 * @return 凭证入库单明细列表
	 */
	public List<VoucherTransferOrderDetail> getVoucherTransferOrderDetailListByTransferOrderId(
			PCPSWebInput webInput, String transferOrderId, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherTransferOrderDetailDaoImpl
				.getVoucherTransferOrderDetailListByTransferOrderId(webInput,
						transferOrderId, page);
	}

	/**
	 * 根据条件查询凭证调拨单明细记录数
	 * 
	 * @param transferOrderId
	 *            调拨单ID
	 * @return 凭证调拨单记录数
	 */
	public BigInteger getVoucherTransferOrderDetailListByTransferOrderIdTotal(
			PCPSWebInput webInput, String transferOrderId) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherTransferOrderDetailDaoImpl
				.getVoucherTransferOrderDetailListByTransferOrderIdTotal(
						webInput, transferOrderId);
	}

	/**
	 * 根据条件查询凭证调拨单明细列表
	 * 
	 * @param transferOrderId
	 *            调拨单ID
	 * @return 凭证入库单明细列表
	 */
	public List<VoucherTransferOrderDetail> getVoucherTransferOrderDetailListByTransferOrderIdNotPage(
			PCPSWebInput webInput, BigInteger transferOrderId) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherTransferOrderDetailDaoImpl
				.getVoucherTransferOrderDetailListByTransferOrderIdNotPage(
						webInput, transferOrderId);
	}

	// 凭证入库单
	@EJB(mappedName = "organization.impl.VoucherInStockOrderDaoImpl")
	private VoucherInStockOrderDao voucherInStockOrderDaoImpl;
	@EJB(mappedName = "organization.impl.VoucherInStockOrderBusinessImpl")
	private VoucherInStockOrderBusiness voucherInStockOrderBusinessImpl;

	/**
	 * 根据条件查询凭证入库单列表
	 * 
	 * @param issueBranchNo
	 *            发卡商机构编号
	 * @param status
	 *            状态
	 * @param startDate
	 *            开始交易日期
	 * @param endDate
	 *            结束交易日期
	 * @param page
	 *            页码
	 * @return 凭证入库单列表
	 */
	public List<VoucherInStockOrder> getVoucherInStockOrderList(
			PCPSWebInput webInput, String issueBranchNo, String status,
			String startDate, String endDate, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherInStockOrderDaoImpl.getVoucherInStockOrderList(webInput,
				issueBranchNo, status, startDate, endDate, page);
	}

	/**
	 * 根据条件查询凭证入库单列表
	 * 
	 * @param issueBranchNo
	 *            发卡商机构编号
	 * @param status
	 *            状态
	 * @param startDate
	 *            开始交易日期
	 * @param endDate
	 *            结束交易日期
	 * @return 凭证入库单记录数
	 */
	public BigInteger getVoucherInStockOrderListTotal(PCPSWebInput webInput,
			String issueBranchNo, String status, String startDate,
			String endDate) {
		return voucherInStockOrderDaoImpl.getVoucherInStockOrderListTotal(
				webInput, issueBranchNo, status, startDate, endDate);
	}

	/**
	 * 根据凭证入库单id查询凭证入库单明细类对象
	 * 
	 * @param voucherInStockOrderId
	 *            凭证入库单id
	 * @return 凭证入库单对象
	 */
	public VoucherInStockOrder getVoucherInStockOrdeVoucherId(
			BigInteger voucherInStockOrderId) {
		return voucherInStockOrderDaoImpl
				.getVoucherInStockOrdeVoucherId(voucherInStockOrderId);
	}

	/**
	 * 新增凭证入库单
	 * 
	 * @param voucherInStockOrder
	 *            凭证入库单
	 * @param List
	 * <VoucherTransferOrder> 凭证入库单明细列表 @
	 */
	public CommonWebResult insertVoucherInStockOrder(PCPSWebInput webInput,
			VoucherInStockOrder voucherInStockOrder,
			List<VoucherInStockOrderDetail> datil) {

		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult commonWebResult = new CommonWebResult();
		commonWebResult.setSuccess(true);
		try {
			commonWebResult.setResult(voucherInStockOrderBusinessImpl
					.insertVoucherInStockOrder(webInput, voucherInStockOrder,
							datil).toString());
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return commonWebResult;
	}

	/**
	 * 修改凭证入库单状态
	 * 
	 * @param voucherInStockOrder
	 * 凭证入库单 @
	 */
	public CommonWebResult updateVoucherInStockOrderByStatus(
			PCPSWebInput webInput, VoucherInStockOrder voucherInStockOrder) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			voucherInStockOrderBusinessImpl.updateVoucherInStockOrderByStatus(
					webInput, voucherInStockOrder);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 凭证入库单明细
	@EJB(mappedName = "organization.impl.VoucherInStockOrderDetailDaoImpl")
	private VoucherInStockOrderDetailDao voucherInStockOrderDetailDaoImpl;

	/**
	 * 根据条件查询凭证入库单明细列表
	 * 
	 * @param voucherInStockOrderId
	 *            入库单ID
	 * @param page
	 *            页码
	 * @return 凭证入库单明细列表
	 */
	public List<VoucherInStockOrderDetail> getVoucherInStockOrderDetailByVoucherInStockOrderId(
			PCPSWebInput webInput, String voucherInStockOrderId, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherInStockOrderDetailDaoImpl
				.getVoucherInStockOrderDetailByVoucherInStockOrderId(webInput,
						voucherInStockOrderId, page);
	}

	/**
	 * 根据条件查询凭证入库单明细
	 * 
	 * @param voucherInStockOrderId
	 *            入库单ID
	 * @return 凭证入库单明细记录数
	 */
	public BigInteger getVoucherInStockOrderDetailByVoucherInStockOrderIdTotal(
			PCPSWebInput webInput, String voucherInStockOrderId) {
		return voucherInStockOrderDetailDaoImpl
				.getVoucherInStockOrderDetailByVoucherInStockOrderIdTotal(
						webInput, voucherInStockOrderId);
	}

	/**
	 * 根据条件查询凭证入库单明细列表
	 * 
	 * @param voucherInStockOrderId
	 *            入库单ID
	 * @return 凭证入库单明细列表
	 */
	public List<VoucherInStockOrderDetail> getVoucherInStockOrderDetailByVoucherInStockOrderIdNotPage(
			PCPSWebInput webInput, BigInteger voucherInStockOrderId) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherInStockOrderDetailDaoImpl
				.getVoucherInStockOrderDetailByVoucherInStockOrderIdNotPage(
						webInput, voucherInStockOrderId);
	}

	// 商户合同
	@EJB(mappedName = "organization.impl.MerchantContractBusinessImpl")
	private MerchantContractBusiness mctBusinessImpl;
	@EJB(mappedName = "organization.impl.MerchantContractDaoImpl")
	private MerchantContractDao mctDaoImpl;

	/**
	 * 根据商户合同主键获取合同信息
	 * 
	 * @param mctId
	 * @return
	 */
	public MerchantContract getMerchantContractById(BigInteger mctId) {
		return mctDaoImpl.getMerchantContractById(mctId);
	}

	/**
	 * 根据商户编号获取商户合同列表
	 * 
	 * @param merchantNo
	 * @return
	 */
	public List<MerchantContract> getMerchantContractDropDownList(
			PCPSWebInput webInput, String merchantNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return mctDaoImpl.getMerchantContractDropDownList(merchantNo);
	}

	/**
	 * 添加商户合同
	 * 
	 * @param webInput
	 * @param mct
	 * @return @
	 */
	public CommonWebResult insertMerchantContract(PCPSWebInput webInput,
			MerchantContract mct) {

		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult result = new CommonWebResult();
		try {
			BigInteger contractId = mctBusinessImpl.insertMerchantContract(
					webInput, mct);
			result.setResult(contractId.toString());
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return result;
	}

	/**
	 * 修改商户合同
	 * 
	 * @param webInput
	 * @param mct
	 * @return @
	 */
	public CommonWebResult updateMerchantContract(PCPSWebInput webInput,
			MerchantContract mct) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			mctBusinessImpl.updateMerchantContract(webInput, mct);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 删除商户合同
	 * 
	 * @param webInput
	 * @param mctId
	 * @return @
	 */
	public CommonWebResult deleteMerchantContract(PCPSWebInput webInput,
			BigInteger mctId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			mctBusinessImpl.deleteMerchantContract(webInput, mctId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 合同审核通过
	 * 
	 * @param webInput
	 * @param mct @
	 */
	public CommonWebResult authMerchantContract(PCPSWebInput webInput,
			BigInteger mctId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			mctBusinessImpl.authMerchantContract(webInput, mctId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 合同审核未通过
	 * 
	 * @param webInput
	 * @param mctId
	 * @return @
	 */
	public CommonWebResult unAuthMerchantContract(PCPSWebInput webInput,
			BigInteger mctId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			mctBusinessImpl.unAuthMerchantContract(webInput, mctId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 合同设置为无效申请
	 * 
	 * @param webInput
	 * @param mct @
	 */
	public CommonWebResult closeMerchantContract(PCPSWebInput webInput,
			BigInteger mctId) {
		commonDaoImpl.setSysLogPath(webInput);
		try {
			mctBusinessImpl.closeMerchantContract(webInput, mctId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 合同延期
	 * 
	 * @param webInput
	 * @param merchantId
	 * @return
	 */
	public CommonWebResult merchantContractExtension(PCPSWebInput webInput,
			BigInteger extensionID, BigInteger extensionMonth) {
		commonDaoImpl.setSysLogPath(webInput);
		try {
			mctBusinessImpl.merchantContractExtension(webInput, extensionID,
					extensionMonth);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据条件(名称、合同编号、时间段)组合查询合同列表
	 * 
	 * @param cntractTitle
	 * @param contractNo
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public List<MerchantContract> getMerchantContractByConditions(
			PCPSWebInput webinput, String contractTitle, String contractNo,
			String startDate, String endDate, String status, Integer page) {

		commonDaoImpl.setSysLogPath(webinput);
		return mctDaoImpl.getMerchantContractByConditions(webinput,
				contractTitle, contractNo, startDate, endDate, status, page);
	}

	/**
	 * 根据条件(名称、合同编号、时间段)组合查询合同总数
	 * 
	 * @param cntractTitle
	 * @param contractNo
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public BigInteger getMerchantContractTotalByConditions(
			PCPSWebInput webinput, String cntractTitle, String contractNo,
			String startDate, String endDate, String status) {
		return mctDaoImpl.getMerchantContractTotalByConditions(webinput,
				cntractTitle, contractNo, startDate, endDate, status);
	}

	/**
	 * 根据时间获取需要提醒商户合同到期列表
	 * 
	 * @param webinput
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public List<MerchantContract> getMerchantContractRemind(
			PCPSWebInput webinput, String startDate, String endDate) {
		return mctDaoImpl.getMerchantContractRemind(webinput, startDate,
				endDate);
	}

	@EJB(mappedName = "organization.impl.MerchantBusinessTypeDaoImpl")
	private MerchantBusinessTypeDao merchantBusinessTypeDao;
	@EJB(mappedName = "organization.impl.MerchantBusinessTypeBusinessImpl")
	private MerchantBusinessTypeBusiness merchantBusinessTypeBusiness;

	/**
	 * 根据商户号查询商户业务类型
	 * 
	 * @param merchantNo
	 * @return
	 */
	public List<MerchantBusinessType> getAllMerchantBusinessTypeByMerchantNo(
			PCPSWebInput webInput, String merchantNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return merchantBusinessTypeDao
				.getAllMerchantBusinessTypeByMerchantNo(merchantNo);
	}

	/**
	 * 根据主键查询商户业务类型
	 * 
	 * @param mbt
	 * @return
	 */
	public MerchantBusinessType getMerchantBusinessTypeByKey(
			MerchantBusinessType mbt) {
		return merchantBusinessTypeDao.getMerchantBusinessTypeByKey(mbt);
	}

	/**
	 * 商户业务类型添加
	 * 
	 * @param webInput
	 * @param mbt
	 * @return @
	 */
	public CommonWebResult merchantBusinessTypeInsert(PCPSWebInput webInput,
			MerchantBusinessType mbt) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantBusinessTypeBusiness.insert(mbt);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 商户业务类型修改
	 * 
	 * @param webInput
	 * @param mbt
	 * @return @
	 */
	public CommonWebResult merchantBusinessTypeUpdate(PCPSWebInput webInput,
			MerchantBusinessType mbt) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantBusinessTypeBusiness.update(mbt);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 商户业务类型删除
	 * 
	 * @param webInput
	 * @param mbt
	 * @return @
	 */
	public CommonWebResult merchantBusinessTypeDelete(PCPSWebInput webInput,
			MerchantBusinessType mbt) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			merchantBusinessTypeBusiness.delete(mbt);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 凭证库存
	@EJB(mappedName = "organization.impl.VoucherStockDaoImpl")
	private VoucherStockDao voucherStockDaoImpl;

	/**
	 * 根据条件查询凭证库存表列表
	 * 
	 * @param toBranchNo
	 *            调入机构号
	 * @param status
	 *            状态
	 * @param voucherId
	 *            凭证种类ID
	 * @param voucherNo
	 *            凭证号
	 * @param page
	 *            页码
	 * @return 凭证入库单明细列表
	 */
	public List<VoucherStock> getVoucherStockList(PCPSWebInput webInput,
			String BranchNo, String status, String voucherId, String startNo,
			String endNo, Boolean isSingle, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherStockDaoImpl.getVoucherStockList(webInput, BranchNo,
				status, voucherId, startNo, endNo, isSingle, page);
	}

	/**
	 * 根据条件查询凭证库存表记录数
	 * 
	 * @param toBranchNo
	 *            调入机构号
	 * @param status
	 *            状态
	 * @param voucherId
	 *            凭证种类ID
	 * @param voucherNo
	 *            凭证号
	 * @param page
	 * @return 凭证库存表录数
	 */
	public BigInteger getVoucherStockListTotal(PCPSWebInput webInput,
			String BranchNo, String status, String voucherId, String startNo,
			String endNo, Boolean isSingle) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherStockDaoImpl.getVoucherStockListTotal(webInput, BranchNo,
				status, voucherId, startNo, endNo, isSingle);
	}

	/**
	 * 根据条件查询凭证库存表列表
	 * 
	 * @param BranchNo
	 *            机构号
	 * @param voucherId
	 *            凭证种类ID
	 * @param page
	 *            页码
	 * @return 凭证库存表列表
	 */
	public List<Object[]> getVoucherStockIndexList(PCPSWebInput webInput,
			String BranchNo, String voucherId) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherStockDaoImpl.getVoucherStockIndexList(webInput, BranchNo,
				voucherId);
	}

	/**
	 * 根据条件查询凭证库存表列表
	 * 
	 * @param toBranchNo
	 *            调入机构号
	 * @param status
	 *            状态
	 * @param voucherId
	 *            凭证种类ID
	 * @param voucherNo
	 *            凭证号
	 * @return 凭证库存表号段列表
	 */
	public List<Object[]> getVoucherStockByCon(PCPSWebInput webInput,
			String BranchNo, String status, String voucherId, String startNo,
			String endNo, Boolean isSingle) {
		commonDaoImpl.setSysLogPath(webInput);
		return voucherStockDaoImpl.getVoucherStockByCon(webInput, BranchNo,
				status, voucherId, startNo, endNo, isSingle);
	}
	/**
	 * 根据凭证种类，机构号，发卡商,状态查询,
	 */
	public List<Object[]> getVoucherStockByBrNo(PCPSWebInput webInput,
			String BranchNo,String voucherId){
		commonDaoImpl.setSysLogPath(webInput);
		return voucherStockDaoImpl.getVoucherStockByBrNo(webInput, BranchNo, voucherId);
	}
	// 凭证出入库明细表
	@EJB(mappedName = "organization.impl.VoucherStockDetailDaoImpl")
	private VoucherStockDetailDao voucherStockDetailDaoImpl;

	/**
	 * 根据条件查询凭证出入库明细列表
	 * 
	 * @param BranchNo
	 *            机构号
	 * @param tranType
	 *            交易类型
	 * @param voucherId
	 *            凭证种类
	 * @param startDate
	 *            起始日期
	 * @param endDate
	 *            终止日期
	 * @param page
	 *            页码
	 * @return 凭证出入库明细列表
	 */
	public List<VoucherStockDetail> getVoucherStockDetailList(
			PCPSWebInput webInput, String BranchNo, String tranType,
			BigInteger voucherId, String startDate, String endDate, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherStockDetailDaoImpl.getVoucherStockDetailList(webInput,
				BranchNo, tranType, voucherId, startDate, endDate, page);
	}

	/**
	 * 根据条件查询凭证出入库明细记录数
	 * 
	 * @param BranchNo
	 *            机构号
	 * @param tranType
	 *            交易类型
	 * @param voucherId
	 *            凭证种类
	 * @param startDate
	 *            起始日期
	 * @param endDate
	 *            终止日期
	 * @return 凭证出入库明细录数
	 */
	public BigInteger getVoucherStockDetailListTotal(PCPSWebInput webInput,
			String BranchNo, String tranType, BigInteger voucherId,
			String startDate, String endDate) {
		return voucherStockDetailDaoImpl.getVoucherStockDetailListTotal(
				webInput, BranchNo, tranType, voucherId, startDate, endDate);
	}

	/**
	 * 根据id，发卡商号检索迁移明细列表
	 */
	public List<VoucherStockDetail> getVoucherStockDetailByid(String IoOrderId,
			String issuecompanyno) {
		return voucherStockDetailDaoImpl.getVoucherStockDetailByid(IoOrderId,
				issuecompanyno);
	}

	// 调拨单申请
	@EJB(mappedName = "cardmanagement.impl.TransferInOutStockApprovalDaoImpl")
	private TransferInOutStockApprovalDao transferInOutStockApprovalDao;

	@EJB(mappedName = "cardmanagement.impl.TransferInOutStockApprovalBusinessImpl")
	private TransferInOutStockApprovalBusiness transferInOutStockApprovalBusiness;

	/**
	 * 调拨单申请单分页查询列表
	 * 
	 * @param webInput
	 * @param approvalBranchNo
	 * @param cardFaceId
	 * @param status
	 * @param startTime
	 * @param endTime
	 * @param page
	 * @return
	 */
	public List<TransferInOutStockApproval> getTransferInOutStockApprovalList(
			PCPSWebInput webInput, String approvalBranchNo, String branchNo,
			BigInteger cardFaceId, String status, String startTime,
			String endTime, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return transferInOutStockApprovalDao.getTransferInOutStockApprovalList(
				webInput, approvalBranchNo, branchNo, cardFaceId, status,
				startTime, endTime, page);
	}

	/**
	 * 调拨单申请单总数查询
	 * 
	 * @param webInput
	 * @param approvalBranchNo
	 * @param cardFaceId
	 * @param status
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	public Integer getTransferInOutStockApprovalCount(PCPSWebInput webInput,
			String approvalBranchNo, String branchNo, BigInteger cardFaceId,
			String status, String startTime, String endTime) {
		return transferInOutStockApprovalDao
				.getTransferInOutStockApprovalCount(webInput, approvalBranchNo,
						branchNo, cardFaceId, status, startTime, endTime);
	}

	/**
	 * 根据主键查询调拨单申请
	 * 
	 * @param TransferApprovalId
	 * @return
	 */
	public TransferInOutStockApproval getTransferInOutStockApprovalByTransferApprovalId(
			BigInteger TransferApprovalId) {
		return transferInOutStockApprovalDao
				.getTransferInOutStockApprovalByTransferApprovalId(TransferApprovalId);
	}

	public SysBranch getToTransferBranchNo(PCPSWebInput webInput) {
		return transferInOutStockApprovalBusiness
				.getToTransferBranchNo(webInput);
	}

	/**
	 * 调拨单申请添加
	 * 
	 * @param vo @
	 */
	public CommonWebResult insertTransferInOutStockApproval(
			PCPSWebInput webInput, TransferInOutStockApproval vo) {

		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult commonWebResult = new CommonWebResult();
		try {
			BigInteger ApprovalOperId = transferInOutStockApprovalBusiness
					.insertTransferInOutStockApproval(webInput, vo);
			commonWebResult.setSuccess(true);
			commonWebResult.setResult(ApprovalOperId.toString());
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return commonWebResult;
	}

	/**
	 * 调拨单申请审批通过
	 * 
	 * @param vo @
	 */
	public CommonWebResult AuthTransferInOutStockApprovalAdopt(
			PCPSWebInput webInput, TransferInOutStockApproval vo) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			transferInOutStockApprovalBusiness
					.AuthTransferInOutStockApprovalAdopt(webInput, vo);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 调拨单申请审批拒绝
	 * 
	 * @param vo @
	 */
	public CommonWebResult AuthTransferInOutStockApprovalRefuse(
			PCPSWebInput webInput, TransferInOutStockApproval vo) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			transferInOutStockApprovalBusiness
					.AuthTransferInOutStockApprovalRefuse(webInput, vo);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 调拨单申请删除
	 * 
	 * @param vo @
	 */
	public CommonWebResult deleteTransferInOutStockApproval(
			PCPSWebInput webInput, BigInteger TransferApprovalId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			transferInOutStockApprovalBusiness
					.deleteTransferInOutStockApproval(webInput,
							TransferApprovalId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 凭证调整单
	@EJB(mappedName = "organization.impl.VoucherAdjustOrderDaoImpl")
	private VoucherAdjustOrderDao voucherAdjustOrderDaoImpl;
	@EJB(mappedName = "organization.impl.VoucherAdjustOrderBusinessImpl")
	private VoucherAdjustOrderBusiness voucherAdjustOrderBusinessDaoImpl;

	/**
	 * 根据条件查询凭证调整单列表--调整单查询
	 * 
	 * @param BranchNo
	 *            调入机构号
	 * @param status
	 *            状态
	 * @param tranType
	 *            交易类型
	 * @param startTranTime
	 *            起始时间
	 * @param endTranTime
	 *            终止时间
	 * @param page
	 *            页码
	 * @return 凭证调整单列表
	 */
	public List<VoucherAdjustOrder> getVoucherAdjustOrderList(
			PCPSWebInput webInput, String BranchNo, String status,
			String TranType, String startTranTime, String endTranTime,
			Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherAdjustOrderDaoImpl.getVoucherAdjustOrderList(webInput,
				BranchNo, status, TranType, startTranTime, endTranTime, page);
	}

	/**
	 * @param BranchNo
	 *            --调整单查询 调入机构号
	 * @param status
	 *            状态
	 * @param tranType
	 *            交易类型
	 * @param startTranTime
	 *            起始时间
	 * @param endTranTime
	 *            终止时间
	 * @return 凭证调整单录数
	 */
	public BigInteger getVoucherAdjustOrderListTotal(PCPSWebInput webInput,
			String BranchNo, String status, String TranType,
			String startTranTime, String endTranTime) {
		return voucherAdjustOrderDaoImpl.getVoucherAdjustOrderListTotal(
				webInput, BranchNo, status, TranType, startTranTime,
				endTranTime);
	}

	/**
	 * 根据条件查询凭证调整单列表--调整单申请查询
	 * 
	 * @param BranchNo
	 *            调入机构号
	 * @param status
	 *            状态
	 * @param tranType
	 *            交易类型
	 * @param startTranTime
	 *            起始时间
	 * @param endTranTime
	 *            终止时间
	 * @param page
	 *            页码
	 * @return 凭证调整单列表
	 */
	public List<VoucherAdjustOrder> getVoucherAdjustOrderByApplyList(
			PCPSWebInput webInput, String BranchNo, String status,
			String TranType, String startTranTime, String endTranTime,
			Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherAdjustOrderDaoImpl.getVoucherAdjustOrderByApplyList(
				webInput, BranchNo, status, TranType, startTranTime,
				endTranTime, page);
	}

	/**
	 * 根据条件查询凭证调整单列表--调整单申请查询
	 * 
	 * @param BranchNo
	 *            调入机构号
	 * @param status
	 *            状态
	 * @param tranType
	 *            交易类型
	 * @param startTranTime
	 *            起始时间
	 * @param endTranTime
	 *            终止时间
	 * @return 凭证调整单录数
	 */
	public BigInteger getVoucherAdjustOrderByApplyListTotal(
			PCPSWebInput webInput, String BranchNo, String status,
			String TranType, String startTranTime, String endTranTime) {
		return voucherAdjustOrderDaoImpl.getVoucherAdjustOrderByApplyListTotal(
				webInput, BranchNo, status, TranType, startTranTime,
				endTranTime);
	}

	/**
	 * 根据条件查询凭证调整单列表--调整单取消申请查询
	 * 
	 * @param BranchNo
	 *            调入机构号
	 * @param status
	 *            状态
	 * @param tranType
	 *            交易类型
	 * @param startTranTime
	 *            起始时间
	 * @param endTranTime
	 *            终止时间
	 * @param page
	 *            页码
	 * @return 凭证调整单列表
	 */
	public List<VoucherAdjustOrder> getVoucherAdjustOrderByCancelList(
			PCPSWebInput webInput, String BranchNo, String status,
			String TranType, String startTranTime, String endTranTime,
			Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherAdjustOrderDaoImpl.getVoucherAdjustOrderByCancelList(
				webInput, BranchNo, status, TranType, startTranTime,
				endTranTime, page);
	}

	/**
	 * 根据条件查询凭证调整单列表--调整单取消申请查询
	 * 
	 * @param BranchNo
	 *            调入机构号
	 * @param status
	 *            状态
	 * @param tranType
	 *            交易类型
	 * @param startTranTime
	 *            起始时间
	 * @param endTranTime
	 *            终止时间
	 * @return 凭证调整单录数
	 */
	public BigInteger getVoucherAdjustOrderByCancelListTotal(
			PCPSWebInput webInput, String BranchNo, String status,
			String TranType, String startTranTime, String endTranTime) {
		return voucherAdjustOrderDaoImpl
				.getVoucherAdjustOrderByCancelListTotal(webInput, BranchNo,
						status, TranType, startTranTime, endTranTime);
	}

	/**
	 * 根据条件查询凭证调整单列表对象
	 * 
	 * @param voucherAdjustOrderId
	 * 调整单ID @
	 */
	public VoucherAdjustOrder getVoucherAdjustOrderById(
			BigInteger voucherAdjustOrderId) {
		return voucherAdjustOrderDaoImpl
				.getVoucherAdjustOrderById(voucherAdjustOrderId);
	}

	/**
	 * 新增凭证调整单
	 * 
	 * @param VoucherAdjustOrder
	 * 凭证调整单 @
	 */
	public CommonWebResult insertVoucherAdjustOrder(PCPSWebInput webInput,
			VoucherAdjustOrder voucherAdjustOrder,
			List<VoucherAdjustOrderDetail> datil) {

		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult commonWebResult = new CommonWebResult();
		commonWebResult.setSuccess(true);
		try {
			commonWebResult.setResult(voucherAdjustOrderBusinessDaoImpl
					.insertVoucherAdjustOrder(webInput, voucherAdjustOrder,
							datil).toString());
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return commonWebResult;
	}

	/**
	 * 修改凭证调整单状态-审核
	 * 
	 * @param VoucherAdjustOrder
	 * 凭证调整单 @
	 */
	public CommonWebResult updateVoucherAdjustOrderByAuditing(
			PCPSWebInput webInput, VoucherAdjustOrder voucherAdjustOrder) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			voucherAdjustOrderBusinessDaoImpl
					.updateVoucherAdjustOrderByAuditing(webInput,
							voucherAdjustOrder);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改凭证调整单状态-取消
	 * 
	 * @param VoucherAdjustOrder
	 * 凭证调整单 @
	 */
	public CommonWebResult updateVoucherAdjustOrderByCancelling(
			PCPSWebInput webInput, VoucherAdjustOrder voucherAdjustOrder) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			voucherAdjustOrderBusinessDaoImpl
					.updateVoucherAdjustOrderByCancelling(webInput,
							voucherAdjustOrder);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改凭证调整单状态-确认
	 * 
	 * @param VoucherAdjustOrder
	 * 凭证调整单 @
	 */
	public CommonWebResult updateVoucherAdjustOrderByConfirm(
			PCPSWebInput webInput, VoucherAdjustOrder voucherAdjustOrder) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			voucherAdjustOrderBusinessDaoImpl
					.updateVoucherAdjustOrderByConfirm(webInput,
							voucherAdjustOrder);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 凭证调整单明细
	@EJB(mappedName = "organization.impl.VoucherAdjustOrderDetailDaoImpl")
	private VoucherAdjustOrderDetailDao voucherAdjustOrderDetailDaoImpl;

	/**
	 * 根据条件查询凭证调整单详细列表
	 * 
	 * @param voucherAdjustOrderId
	 *            调整单ID
	 * @param page
	 *            页码
	 * @return 凭证调整单详细列表
	 */
	public List<VoucherAdjustOrderDetail> getVoucherAdjustOrderDetailList(
			PCPSWebInput webInput, BigInteger voucherAdjustOrderId, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherAdjustOrderDetailDaoImpl.getVoucherAdjustOrderDetailList(
				webInput, voucherAdjustOrderId, page);
	}

	/**
	 * 根据条件查询凭证调整单详细总数
	 * 
	 * @param voucherAdjustOrderId
	 *            调整单ID
	 * @return 凭证调整单详细录数
	 */
	public BigInteger getVoucherAdjustOrderDetailListTotal(
			PCPSWebInput webInput, BigInteger voucherAdjustOrderId) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherAdjustOrderDetailDaoImpl
				.getVoucherAdjustOrderDetailListTotal(webInput,
						voucherAdjustOrderId);
	}

	/**
	 * 根据条件查询凭证调整单详细列表
	 * 
	 * @param voucherAdjustOrderId
	 *            调整单ID
	 * @return 凭证调整单详细列表
	 */
	public List<VoucherAdjustOrderDetail> getVoucherAdjustOrderDetailListNoPage(
			PCPSWebInput webInput, BigInteger voucherAdjustOrderId) {

		commonDaoImpl.setSysLogPath(webInput);
		return voucherAdjustOrderDetailDaoImpl
				.getVoucherAdjustOrderDetailListNoPage(webInput,
						voucherAdjustOrderId);
	}

	@EJB(mappedName = "organization.impl.VoucherStockBusinessImpl")
	private VoucherStockBusiness voucherStockBusinessImpl;

	/**
	 * 查询凭证号是否可用
	 * 
	 * @param voucherStock
	 * @param input
	 * @return @
	 */
	public SaleOrderResult getVoucherStockByCondition(
			VoucherStock voucherStock, PCPSWebInput input) {

		commonDaoImpl.setSysLogPath(input);
		VoucherStock vs = null;
		try {
			vs = voucherStockBusinessImpl.getVoucherStockByCondition(
					voucherStock, input);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new SaleOrderResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new SaleOrderResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		SaleOrderResult sor = new SaleOrderResult();
		sor.setVoucherStock(vs);
		return sor;
	}

	/**
	 * 根据凭证号查询
	 * 
	 * @param voucherNo
	 * @param input
	 * @return
	 */
	public VoucherStock getVoucherStockByVoucherNo(String voucherNo,
			PCPSWebInput input) {

		commonDaoImpl.setSysLogPath(input);
		return voucherStockDaoImpl.getVoucherStockByVoucherNo(voucherNo, input);
	}

	@EJB(mappedName = "transaction.impl.MrchBusinessImpl")
	private MrchBusiness mrchBusinessImpl;

	/**
	 * 手工调帐
	 * 
	 * @param adjustMerchantNo
	 *            待调帐商户号
	 * @param adjustTranSeqNo
	 *            待调帐流水号
	 * @param adjustTranDate
	 *            待调帐日期
	 * @param amount
	 *            原交易发生金额
	 * @param operId
	 *            调帐人ID
	 * @param remark
	 *            调帐备注
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult AdjustAccount(PCPSWebInput webInput,
			String adjustMerchantNo, String adjustTranSeqNo,
			Date adjustTranDate, BigInteger amount, String remark) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			mrchBusinessImpl.AdjustAccount(adjustMerchantNo, adjustTranSeqNo,
					adjustTranDate, amount, webInput.getOperId(), remark);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 商户交易差错处理
	 * 
	 * @param webInput
	 * @param mmObj
	 * @return
	 */
	public MchMistakeResult MistakeAccount(PCPSWebInput webInput,
			MchMistakeObject mmObj) {

		commonDaoImpl.setSysLogPath(webInput);
		MchMistakeObject result = null;
		try {
			result = mrchBusinessImpl.MistakeAccount(mmObj);
		} catch (PCPSApplicationException p) {
			return new MchMistakeResult(PCPSUtil.FAILED,
					p.getErrCodeCategory(), p.getErrMsg());
		} catch (Exception e) {
			new MchMistakeResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new MchMistakeResult(result);
	}

	/**
	 * 预付卡业务风险预警表--报表
	 * 
	 * @param webInput
	 * @param branchno
	 *            预警机构
	 * @param startAlarmTime
	 *            预警起始时间
	 * @param endAlarmTime
	 *            预警终止时间
	 * @return list对象
	 */
	public List<Object[]> getAlarmInfoReport(PCPSWebInput webInput,
			Date startAlarmTime, Date endAlarmTime, String dealStatus,
			String normalOrSuspicious) {

		commonDaoImpl.setSysLogPath(webInput);
		return alarmInfoDaoImpl.getAlarmInfoReport(webInput, startAlarmTime,
				endAlarmTime, dealStatus, normalOrSuspicious);
	}

	/**
	 * ------------------------------清分结算比率校验---------------------------- --
	 */
	// 商户脱机消费终端管理
	@EJB(mappedName = "datasorting.impl.InComeSortingBusinessImpl")
	private InComeSortingBusiness InComeSortingBusinessImpl;

	/**
	 * 校验某商户某日的结算策略设置是否合法
	 * 
	 * @param issueCompanyNo
	 * @param trandate
	 * @return ok代表通过其他情况为错误信息
	 */

	public String checkMerchantFeeSettlementPolicy(String issueCompanyNo,
			Date trandate) {
		return InComeSortingBusinessImpl.checkMerchantFeeSettlementPolicy(
				issueCompanyNo, trandate);
	}

	/**
	 * ------------------------------燃气车加气卡服务接口Start---------------------------- --
	 */
	// 商户脱机消费终端管理
	@EJB(mappedName = "organization.impl.ConsumeTerminalDaoImpl")
	private ConsumeTerminalDao ctDao;
	@EJB(mappedName = "organization.impl.ConsumeTerminalBusinessImpl")
	private ConsumeTerminalBusiness ctBusiness;

	/**
	 * 根据读卡器号获取 商户脱机消费终端管理信息
	 * 
	 * @param terminalNo
	 * @return
	 */
	public ConsumeTerminal getConsumeTerminalByTerminalNo(String terminalNo) {
		return ctDao.getConsumeTerminalByTerminalNo(terminalNo);
	}

	/**
	 * 增加 商户脱机消费终端管理信息
	 * 
	 * @param webInput
	 * @param ct
	 * @return @
	 */
	public CommonWebResult insertConsumeTerminal(PCPSWebInput webInput,
			ConsumeTerminal ct) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			ctBusiness.insertConsumeTerminal(webInput, ct);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改 商户脱机消费终端管理信息
	 * 
	 * @param webInput
	 * @param ct
	 * @return @
	 */
	public CommonWebResult updateConsumeTerminal(PCPSWebInput webInput,
			ConsumeTerminal ct) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			ctBusiness.updateConsumeTerminal(webInput, ct);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据查询条件获取 商户脱机消费终端管理信息列表
	 * 
	 * @param webInput
	 * @param merchantNo
	 * @param merchantBranchNo
	 * @param terminalNo
	 * @param page
	 * @return
	 */
	public List<ConsumeTerminal> getConsumeTerminalListByConditons(
			PCPSWebInput webInput, String merchantNo, String merchantBranchNo,
			String terminalNo, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return ctDao.getConsumeTerminalListByConditons(webInput, merchantNo,
				merchantBranchNo, terminalNo, page);
	}

	/**
	 * 根据查询条件获取 商户脱机消费终端管理信息总数
	 * 
	 * @param webInput
	 * @param merchantNo
	 * @param merchantBranchNo
	 * @param terminalNo
	 * @return
	 */
	public Integer getConsumeTerminalTotalByConditons(PCPSWebInput webInput,
			String merchantNo, String merchantBranchNo, String terminalNo) {
		return ctDao.getConsumeTerminalTotalByConditons(webInput, merchantNo,
				merchantBranchNo, terminalNo);
	}

	// 应用管理信息
	@EJB(mappedName = "cardmanagement.impl.AppManagementDaoImpl")
	private AppManagementDao appManagementDaoImpl;
	@EJB(mappedName = "cardmanagement.impl.AppManagementBusinessImpl")
	private AppManagementBusiness appManagementBusinessImpl;

	public AppManagement getAppManagementByAppId(BigInteger appId) {
		return appManagementDaoImpl.getAppManagementByAppId(appId);
	}

	public Integer getAppManagementTotal() {
		return appManagementDaoImpl.getAppManagementTotal();
	}

	public List<AppManagement> getAppManagementList(PCPSWebInput webInput,
			Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return appManagementDaoImpl.getAppManagementList(page);
	}

	/**
	 * 根据appids获取应用列表 appids用","隔开
	 * 
	 * @param appids
	 * @return
	 */
	public List<AppManagement> getAppManageListByAppIds(PCPSWebInput webInput,
			String appids) {

		commonDaoImpl.setSysLogPath(webInput);
		return appManagementDaoImpl.getAppManageListByAppIds(appids);
	}

	/**
	 * 新增 应用管理信息
	 * 
	 * @param input
	 * @param amg @
	 */
	public CommonWebResult insertAppManagement(PCPSWebInput input,
			AppManagement amg) {

		commonDaoImpl.setSysLogPath(input);
		try {
			appManagementBusinessImpl.insertAppManagement(input, amg);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改 应用管理信息
	 * 
	 * @param input
	 * @param amg @
	 */
	public CommonWebResult updateAppManagement(PCPSWebInput input,
			AppManagement amg) {

		commonDaoImpl.setSysLogPath(input);
		try {
			appManagementBusinessImpl.updateAppManagement(input, amg);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 通用读CPU卡指令
	 * 
	 * @return @
	 */
	public String generateReadCardApdu(PCPSWebInput webInput) {

		commonDaoImpl.setSysLogPath(webInput);
		return ApduExecuteObj.codingApduExecuteObj(appManagementBusinessImpl
				.generateReadCardApdu());
	}

	/**
	 * 解析读指令结果,返回CPU卡信息
	 * 
	 * @param aeo
	 * @return @
	 */
	public AppZoneInfResult parseReadCardApdu(PCPSWebInput webInput,
			ApduExecuteObj aeo) {

		commonDaoImpl.setSysLogPath(webInput);
		AppZoneInfResult aziResult = new AppZoneInfResult();
		try {
			ApduExecuteObj newAeo = ApduExecuteObj.resolveApduExecuteObj(aeo
					.getApduString());
			aziResult.setAppZoneInf(appManagementBusinessImpl
					.parseReadCardApdu(newAeo));
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new AppZoneInfResult(PCPSUtil.FAILED,
					p.getErrCodeCategory(), p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new AppZoneInfResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return aziResult;
	}

	// 银行管理信息
	@EJB(mappedName = "organization.impl.BankManageDaoImpl")
	private BankManageDao bankManageDaoImpl;
	@EJB(mappedName = "organization.impl.BankManageBusinessImpl")
	private BankManageBusiness bankManageBusinessImpl;

	public BankManage getBankManageByBankManageId(BigInteger bankManageId) {
		return bankManageDaoImpl.getBankManageByBankManageId(bankManageId);
	}

	public Integer getBankManageTotal() {
		return bankManageDaoImpl.getBankManageTotal();
	}

	public List<BankManage> getBankManageList(PCPSWebInput webInput,
			Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return bankManageDaoImpl.getBankManageList(page);
	}

	/**
	 * 新增 银行管理信息
	 * 
	 * @param input
	 * @param bmg @
	 */
	public CommonWebResult insertBankManagement(PCPSWebInput input,
			BankManage bmg) {

		commonDaoImpl.setSysLogPath(input);
		try {
			bankManageBusinessImpl.insertBankManagement(input, bmg);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改 银行管理信息
	 * 
	 * @param input
	 * @param bmg @
	 */
	public CommonWebResult updateBankManagement(PCPSWebInput input,
			BankManage bmg) {

		commonDaoImpl.setSysLogPath(input);
		try {
			bankManageBusinessImpl.updateBankManagement(input, bmg);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	@EJB(mappedName = "salesmanage.impl.GasAutoManagementBusinessImpl")
	private GasAutoManagementBusiness gasAutoManagementBusinessImpl;

	public CommonWebResult createGasAutoManagement(PCPSWebInput input,
			GasAutoManagement gamg, BankAssoc ba, SaleOrder saleOrder,
			List<SaleOrderCardDetail> cardDetailList,
			List<SaleOrderPaidDetail> paidDetailList) {

		commonDaoImpl.setSysLogPath(input);
		try {
			gasAutoManagementBusinessImpl.createGasAutoManagement(input, gamg,
					ba, saleOrder, cardDetailList, paidDetailList);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 开卡成功后更新双方系统
	 * 
	 * @param input
	 * @param gamg
	 * @param ba
	 * @param bm
	 * @return @
	 */
	public CommonWebResult updateThirdSystem(PCPSWebInput input,
			GasAutoManagement gamg, BankAssoc ba, BankManage bm) {

		commonDaoImpl.setSysLogPath(input);
		try {
			gasAutoManagementBusinessImpl
					.updateThirdSystem(input, gamg, ba, bm);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 卡发行预处理
	@EJB(mappedName = "cardmanagement.impl.CardATSDaoImpl")
	private CardATSDao cardATSDaoImpl;
	@EJB(mappedName = "cardmanagement.impl.CardATSBusinessImpl")
	private CardATSBusiness cardATSBusinessImpl;

	/**
	 * 根据CPU卡ATS号获取卡ATS信息表
	 * 
	 * @param ats
	 * @return
	 */
	public List<CardATS> getCardATSByAts(PCPSWebInput webInput, String ats) {

		commonDaoImpl.setSysLogPath(webInput);
		return cardATSDaoImpl.getCardATSByAts(ats);
	}

	/**
	 * 根据卡号获取卡ATS信息表
	 * 
	 * @param cardNo
	 * @return
	 */
	public List<CardATS> getCardATSByCardNo(PCPSWebInput webInput, String cardNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return cardATSDaoImpl.getCardATSByCardNo(cardNo);
	}

	/**
	 * 根据卡序号获取卡ATS信息表
	 * 
	 * @param cardSeqNo
	 * @return
	 */
	public List<CardATS> getCardATSByCardSeqNo(PCPSWebInput webInput,
			String cardSeqNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return cardATSDaoImpl.getCardATSByCardSeqNo(cardSeqNo);
	}

	/**
	 * 卡发行初始化
	 * 
	 * @param webInput
	 * @param cats
	 * @return
	 */
	public CommonWebResult pretreatCardATS(PCPSWebInput webInput, CardATS cats,
			BigInteger appId) {

		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult cwr = new CommonWebResult();
		try {
			String apdu = cardATSBusinessImpl.pretreatCardATS(webInput, cats,
					appId);
			cwr.setResult(apdu);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return cwr;
	}

	// 联机转账
	@EJB(mappedName = "account.impl.OnlineTransferDetailDaoImpl")
	private OnlineTransferDetailDao otdDaoImpl;
	@EJB(mappedName = "account.impl.OnlineTransferDetailBusinessImpl")
	private OnlineTransferDetailBusiness otdBusinessImpl;

	/**
	 * 根据流水号,获取联机转账明细
	 * 
	 * @param localSeqNo
	 * @return
	 */
	public OnlineTransferDetail getOnlineTransferDetailByLocalSeqNo(
			PCPSWebInput webInput, String localSeqNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return otdDaoImpl.getOnlineTransferDetailByLocalSeqNo(localSeqNo);
	}

	/**
	 * 根据查询条件查询获取联机转账明细列表
	 * 
	 * @param webInput
	 * @param localSeqNo
	 * @param saleBranchNo
	 * @param startTime
	 * @param endTime
	 * @param tranType
	 * @param status
	 * @param checkStatus
	 * @param page
	 * @return
	 */
	public List<OnlineTransferDetail> getOnlineTransferDetailList(
			PCPSWebInput webInput, String localSeqNo, String cardNo,
			String saleBranchNo, String startTime, String endTime,
			String tranType, String status, String checkStatus, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return otdDaoImpl.getOnlineTransferDetailList(webInput, localSeqNo,
				cardNo, saleBranchNo, startTime, endTime, tranType, status,
				checkStatus, page);
	}

	/**
	 * 根据查询条件查询获取联机转账明细总数
	 * 
	 * @param webInput
	 * @param localSeqNo
	 * @param saleBranchNo
	 * @param startTime
	 * @param endTime
	 * @param tranType
	 * @param status
	 * @param checkStatus
	 * @return
	 */
	public BigInteger getOnlineTransferDetailTotal(PCPSWebInput webInput,
			String localSeqNo, String cardNo, String saleBranchNo,
			String startTime, String endTime, String tranType, String status,
			String checkStatus) {
		return otdDaoImpl.getOnlineTransferDetailTotal(webInput, localSeqNo,
				cardNo, saleBranchNo, startTime, endTime, tranType, status,
				checkStatus);
	}

	/**
	 * 联机转账充值
	 * 
	 * @param webInput
	 * @param cardNo
	 * @param amount
	 * @param bankManageId
	 * @param remark
	 * @return @
	 */
	public CommonWebResult onlineTransferDeposit(PCPSWebInput webInput,
			String cardNo, BigInteger amount, BigInteger bankManageId,
			String remark) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			otdBusinessImpl.onlineTransferDeposit(webInput, cardNo, amount,
					bankManageId, remark);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	// 卡应用关联
	@EJB(mappedName = "cardmanagement.impl.AppCardFaceAssocDaoImpl")
	private AppCardFaceAssocDao appCardFaceAssocDaoImpl;
	@EJB(mappedName = "cardmanagement.impl.AppCardFaceAssocBusinessImpl")
	private AppCardFaceAssocBusiness appCardFaceAssocBusinessImpl;

	/**
	 * 获取应用卡面关联表信息
	 * 
	 * @param acfa
	 * @return
	 */
	public AppCardFaceAssoc getAppCardFaceAssoc(AppCardFaceAssoc acfa) {
		return appCardFaceAssocDaoImpl.getAppCardFaceAssoc(acfa);
	}

	/**
	 * 新增应用卡面关联表
	 * 
	 * @param acfa @
	 */
	public void insert(PCPSWebInput webInput, AppCardFaceAssoc acfa) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			appCardFaceAssocDaoImpl.insert(acfa);
		} catch (PCPSApplicationException e) {
			e.printStackTrace();
		}
	}

	/**
	 * 更新应用卡面关联表
	 * 
	 * @param acfa @
	 */
	public void update(PCPSWebInput webInput, AppCardFaceAssoc acfa) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			appCardFaceAssocDaoImpl.update(acfa);
		} catch (PCPSApplicationException e) {
			e.printStackTrace();
		}
	}

	/**
	 * 根据卡Id移除卡应用
	 * 
	 * @param cardFaceId @
	 */
	public void remove(PCPSWebInput webInput, BigInteger cardFaceId) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			appCardFaceAssocDaoImpl.remove(cardFaceId);
		} catch (PCPSApplicationException e) {
			e.printStackTrace();
		}
	}

	/**
	 * 根据卡ID得到关联表
	 * 
	 * @param cardFaceId
	 * @return @
	 */
	public List<AppCardFaceAssoc> getAppCardFaceAssocByCardId(
			PCPSWebInput webInput, String cardFaceId) {

		commonDaoImpl.setSysLogPath(webInput);
		return appCardFaceAssocDaoImpl.getAppCardFaceAssocByCardId(cardFaceId);
	}

	/**
	 * 绑定卡应用
	 * 
	 * @param input
	 * @param cardId
	 * @param appID @
	 */
	public CommonWebResult bindCardApply(PCPSWebInput input, BigInteger cardId,
			AppCardFaceAssoc[] acfas) {

		commonDaoImpl.setSysLogPath(input);
		try {
			appCardFaceAssocBusinessImpl.bindCardApply(input, cardId, acfas);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return new CommonWebResult();
	}

	// 联机圈存
	@EJB(mappedName = "account.impl.OnlineLoadDetailDaoImpl")
	private OnlineLoadDetailDao oldDaoImpl;
	@EJB(mappedName = "account.impl.OnlineLoadDetailBusinessImpl")
	private OnlineLoadDetailBusiness oldBusinessImpl;

	/**
	 * 根据流水号,获取联机圈存明细
	 * 
	 * @param loadSeqNo
	 * @return
	 */
	public OnlineLoadDetail getOnlineLoadDetailByLocalSeqNo(
			PCPSWebInput webInput, String loadSeqNo) {

		commonDaoImpl.setSysLogPath(webInput);
		return oldDaoImpl.getOnlineLoadDetailByLocalSeqNo(loadSeqNo);
	}

	/**
	 * 根据查询条件查询 获取联机圈存明细列表
	 * 
	 * @param webInput
	 * @param loadSeqNo
	 * @param saleBranchNo
	 * @param startTime
	 * @param endTime
	 * @param tranType
	 * @param status
	 * @return
	 */
	public List<OnlineLoadDetail> getOnlineLoadDetailList(
			PCPSWebInput webInput, String loadSeqNo, String cardNo,
			String saleBranchNo, String startTime, String endTime,
			String tranType, String status, Integer page) {

		commonDaoImpl.setSysLogPath(webInput);
		return oldDaoImpl.getOnlineLoadDetailList(webInput, loadSeqNo, cardNo,
				saleBranchNo, startTime, endTime, tranType, status, page);
	}

	/**
	 * 根据查询条件查询 获取联机圈存明细总数
	 * 
	 * @param webInput
	 * @param loadSeqNo
	 * @param saleBranchNo
	 * @param startTime
	 * @param endTime
	 * @param tranType
	 * @param status
	 * @return
	 */
	public BigInteger getOnlineLoadDetailTotal(PCPSWebInput webInput,
			String loadSeqNo, String cardNo, String saleBranchNo,
			String startTime, String endTime, String tranType, String status) {
		return oldDaoImpl.getOnlineLoadDetailTotal(webInput, loadSeqNo, cardNo,
				saleBranchNo, startTime, endTime, tranType, status);
	}

	/**
	 * 将APDU指令的结果进行解析,返回本应用特定的对象
	 * 
	 * @param webInput
	 * @param am
	 * @param aeo
	 * @return @
	 */
	public AppZoneInfResult parseAppZoneObject(PCPSWebInput webInput,
			AppManagement am, ApduExecuteObj aeo) {

		commonDaoImpl.setSysLogPath(webInput);
		AppZoneInf azi = null;
		try {
			azi = oldBusinessImpl.parseAppZoneObject(webInput, am, aeo);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new AppZoneInfResult(PCPSUtil.FAILED,
					p.getErrCodeCategory(), p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new AppZoneInfResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new AppZoneInfResult(azi);
	}

	/**
	 * 将指定应用特定的对象进行HTML渲染,以驱动客户端展现
	 * 
	 * @param webInput
	 * @param am
	 * @param appObj
	 * @return @
	 */
	public AppZoneInfResult renderAppZoneObject(PCPSWebInput webInput,
			AppManagement am, AppZoneInf appObj) {

		commonDaoImpl.setSysLogPath(webInput);
		AppZoneInfResult aziResult = new AppZoneInfResult();
		try {
			String apdu = oldBusinessImpl.renderAppZoneObject(webInput, am,
					appObj);
			aziResult.setApdu(apdu);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new AppZoneInfResult(PCPSUtil.FAILED,
					p.getErrCodeCategory(), p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new AppZoneInfResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return aziResult;
	}

	/**
	 * 圈存前验证,并记流水
	 * 
	 * @param webInput
	 * @param chkObj
	 * @return @
	 */
	public LoadApduResult checkOnlineLoad(PCPSWebInput webInput,
			OnlineLoadDetail chkObj, AppZoneInf appObj) {

		commonDaoImpl.setSysLogPath(webInput);
		ApduExecuteObj aeo = null;
		try {
			aeo = oldBusinessImpl.checkOnlineLoad(webInput, chkObj, appObj);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new LoadApduResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new LoadApduResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new LoadApduResult(aeo);
	}

	/**
	 * 圈存初始化,已记账
	 * 
	 * @param webInput
	 * @param chkObj
	 * @return @
	 */
	public LoadApduResult initOnlineLoad(PCPSWebInput webInput,
			OnlineLoadDetail initObj, ApduExecuteObj aeo) {

		commonDaoImpl.setSysLogPath(webInput);
		ApduExecuteObj aeobj = null;
		try {
			aeobj = oldBusinessImpl.initOnlineLoad(webInput, initObj, aeo);
		} catch (PCPSApplicationException p) {
			PCPSUtil.Log(p.getSubSysName(), p);
			return new LoadApduResult(PCPSUtil.FAILED, p.getErrCodeCategory(),
					p.getErrMsg());
		} catch (Exception e) {
			PCPSUtil.Log(e.getMessage(), e);
			return new LoadApduResult(PCPSUtil.FAILED,
					CommonWebResult.THROW_EXCEPTION,
					CommonWebResult.THROW_EXCEPTION_MSG);
		}
		return new LoadApduResult(aeobj);
	}

	/**
	 * 解析圈存结果
	 * 
	 * @param webInput
	 * @param loadObj
	 * @param aeo
	 * @return @
	 */
	public CommonWebResult resolveLoadResult(PCPSWebInput webInput,
			String loadSeqNo, ApduExecuteObj aeo) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			oldBusinessImpl.resolveLoadResult(webInput, loadSeqNo, aeo);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return new CommonWebResult();
	}

	/**
	 * 更新流水状态
	 * 
	 * @param webInput
	 * @param loadSeqNo
	 * @param status
	 * @return @
	 */
	public CommonWebResult changeOnlineLoadStatus(PCPSWebInput webInput,
			String loadSeqNo, String status) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			oldBusinessImpl.changeOnlineLoadStatus(webInput, loadSeqNo, status);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return new CommonWebResult();
	}

	/**
	 * 手工调整圈存
	 * 
	 * @param webInput
	 * @param initObj
	 * @return @
	 */
	public CommonWebResult adjustOnlineLoad(PCPSWebInput webInput,
			OnlineLoadDetail initObj) {

		commonDaoImpl.setSysLogPath(webInput);
		try {
			oldBusinessImpl.adjustOnlineLoad(webInput, initObj);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return new CommonWebResult();
	}

	@EJB(mappedName = "common.impl.GlobalDaoImpl")
	private GlobalDao globalDao;

	/**
	 * 查询公用参数列表
	 * 
	 * @return
	 */
	public List<Global> getGlobalList() {
		return globalDao.getGlobalList();
	}

	/**
	 * 测试预警规则
	 */
	public void AlarmRuleTest() {
		try {
			InitialContext ctx = new InitialContext();
			AlarmRulesBusiness arb = (AlarmRulesBusiness) ctx
					.lookup("antimoney.impl.AlarmRule7#"
							+ AlarmRulesBusiness.class.getName());
			AlarmRule ar = alarmRuleDaoImpl
					.getAlarmRuleById(new BigInteger("8"));
			if (arb != null) {
				// 执行该预警规则
				arb.runAlarmRules("961850", PCPSUtil
						.getDateYMDByString("2013-05-06"), ar);
			} else {
				// System.out.println("lookup未找到Bean");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void AlarmRuleTest9(String issuecompanyno, String date) {
		try {
			InitialContext ctx = new InitialContext();
			AlarmRulesBusiness arb = (AlarmRulesBusiness) ctx
					.lookup("antimoney.impl.AlarmRule9#"
							+ AlarmRulesBusiness.class.getName());
			AlarmRule ar = alarmRuleDaoImpl
					.getAlarmRuleById(new BigInteger("9"));
			if (arb != null) {
				// 执行该预警规则
				arb.runAlarmRules(issuecompanyno, PCPSUtil
						.getDateYMDByString(date), ar);
			} else {
				// System.out.println("lookup未找到Bean");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void AlarmRuleTest10(String issuecompanyno, String date) {
		try {
			InitialContext ctx = new InitialContext();
			AlarmRulesBusiness arb = (AlarmRulesBusiness) ctx
					.lookup("antimoney.impl.AlarmRule10#"
							+ AlarmRulesBusiness.class.getName());
			AlarmRule ar = alarmRuleDaoImpl.getAlarmRuleById(new BigInteger(
					"10"));
			if (arb != null) {
				// 执行该预警规则
				arb.runAlarmRules(issuecompanyno, PCPSUtil
						.getDateYMDByString(date), ar);
			} else {
				// System.out.println("lookup未找到Bean");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * ------------------------------燃气车加气卡服务接口End------------------------------
	 */

	// 临时领卡\缴回单
	@EJB(mappedName = "cardmanagement.impl.SalesGetCardOrderBusinessImpl")
	private SalesGetCardOrderBusiness sgcoBusinessImpl;
	@EJB(mappedName = "cardmanagement.impl.SalesGetCardOrderDaoImpl")
	private SalesGetCardOrderDao sgcoDaoImpl;
	// 临时领卡\缴回单明细
	@EJB(mappedName = "cardmanagement.impl.SalesGetCardOrderDetailDaoImpl")
	private SalesGetCardOrderDetailDao sgcodDaoImpl;

	/**
	 * 新增临时领卡\缴回单
	 * 
	 * @param webInput
	 * @param sgco
	 * @return
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult addSalesGetCardOrder(PCPSWebInput webInput,
			SalesGetCardOrder sgco, List<SalesGetCardOrderDetail> detialList)
			throws PCPSApplicationException {

		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult result = new CommonWebResult();
		try {
			BigInteger orderId = sgcoBusinessImpl.addSalesGetCardOrder(
					webInput, sgco, detialList);
			result.setResult(orderId.toString());
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return result;
	}

	/**
	 * 根据主键获取临时领卡\缴回单
	 * 
	 * @param salesGetCardOrderId
	 * @return
	 */
	public SalesGetCardOrder getSalesGetCardOrderByOrderId(
			BigInteger salesGetCardOrderId) {
		return sgcoDaoImpl.getInfoByOrderId(salesGetCardOrderId);
	}

	/**
	 * 根据主键获取临时领卡\缴回单明细
	 * 
	 * @param salesGetCardOrderId
	 * @param orderItemSeqNo
	 * @return
	 */
	public SalesGetCardOrderDetail getSalesGetCardOrderDetailByDetailId(
			BigInteger salesGetCardOrderId, Integer orderItemSeqNo) {
		return sgcodDaoImpl.getInfoByDetailId(salesGetCardOrderId,
				orderItemSeqNo);
	}

	/**
	 * 根据临时领卡\缴回单号,获取对应明细列表
	 * 
	 * @param salesGetCardOrderId
	 * @return
	 */
	public List<SalesGetCardOrderDetail> getSalesGetCardOrderDetailList(
			BigInteger salesGetCardOrderId) {
		return sgcodDaoImpl.getSalesGetCardOrderDetailList(salesGetCardOrderId);
	}

	/**
	 * 根据条件获取临时领卡\缴回单列表
	 * 
	 * @param input
	 * @param salesGetCardOrderNo
	 * @param saleBranchNo
	 * @param tranDate
	 * @param orderType
	 * @param page
	 * @return
	 */
	public List<SalesGetCardOrder> getSalesGetCardOrderByConditions(
			PCPSWebInput input, String salesGetCardOrderNo,
			String saleBranchNo, String startTranDate, String endTranDate,
			String orderType, Integer page) {
		return sgcoDaoImpl.getSalesGetCardOrderByConditions(input,
				salesGetCardOrderNo, saleBranchNo, startTranDate, endTranDate,
				orderType, page);
	}

	/**
	 * 根据条件获取临时领卡\缴回单列表总数
	 * 
	 * @param input
	 * @param salesGetCardOrderNo
	 * @param saleBranchNo
	 * @param tranDate
	 * @param orderType
	 * @return
	 */
	public BigInteger getSalesGetCardOrderTotalByConditions(PCPSWebInput input,
			String salesGetCardOrderNo, String saleBranchNo,
			String startTranDate, String endTranDate, String orderType) {
		return sgcoDaoImpl.getSalesGetCardOrderTotalByConditions(input,
				salesGetCardOrderNo, saleBranchNo, startTranDate, endTranDate,
				orderType);
	}

	@EJB(mappedName = "capitalaccounts.impl.BankAccountDetailBusinessImpl")
	private BankAccountDetailBusiness bankAccountDetailBusinessImpl;

	@EJB(mappedName = "capitalaccounts.impl.BankAccountDetailDaoImpl")
	private BankAccountDetailDao bankAccountDetailDao;

	/**
	 * 根据凭证号、银行记账流水号和银行ID查询入账流水
	 * 
	 * @param bankAccountId
	 *            银行ID
	 * @param voucherNo
	 *            凭证号
	 * @param bankAccSeqNo
	 *            银行记账流水号
	 * @return
	 */
	public BankAccountDetail getBankAccountDetailByVoucherAndBankAccSeqNo(
			BigInteger bankAccountId, String voucherNo, String bankAccSeqNo) {
		return bankAccountDetailDao
				.getBankAccountDetailByVoucherAndBankAccSeqNo(bankAccountId,
						voucherNo, bankAccSeqNo);
	}

	/**
	 * 入账流水审核
	 * 
	 * @param webInput
	 * @param list
	 * @param importFileId
	 * @return
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult authBankAccountDetail(PCPSWebInput webInput,
			BigInteger importFileId) throws PCPSApplicationException {

		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult result = new CommonWebResult();
		try {
			bankAccountDetailBusinessImpl.authBankAccountDetail(webInput,
					importFileId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return result;
	}

	/**
	 * 手动审核
	 * 
	 * @param webInput
	 * @param entity
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult manuallyAuthBankAccountDetail(PCPSWebInput webInput,
			BankAccountDetail entity) throws PCPSApplicationException {

		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult result = new CommonWebResult();
		try {
			bankAccountDetailBusinessImpl.manuallyAuthBankAccountDetail(
					webInput, entity);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return result;
	}

	/**
	 * 根据id获取银行账户入账流水
	 * 
	 * @param bankAccDetailId
	 *            银行账户入账流水ID
	 * @return
	 */
	public BankAccountDetail getBankAccountDetailByID(BigInteger bankAccDetailId) {
		return bankAccountDetailBusinessImpl
				.getBankAccountDetailByID(bankAccDetailId);
	}

	/**
	 * 根据银行账户ID获取银行账户入账流水
	 * 
	 * @param bankAccountId
	 *            银行账户ID
	 * @param page
	 *            分页号
	 * @return
	 */
	public Integer getBankAccountDetailByAccIDTotal(PCPSWebInput webInput,
			BigInteger accountNoId, String status, Date startDate,
			Date endDate, String voucherNo, BigInteger startAmount,
			BigInteger endAmount, BigInteger createBranchNo, String isSingle,
			String paidType, String lenghtSection)
			throws CapitalApplicationException {
		return bankAccountDetailBusinessImpl.getBankAccountDetailByAccIDTotal(
				webInput, accountNoId, status, startDate, endDate, voucherNo,
				startAmount, endAmount, createBranchNo, isSingle, paidType,
				lenghtSection);
	}

	/**
	 * 打包提交时下拉银行入账流水编号
	 * 
	 * @param webInput
	 * @param SaleBranchNo
	 * @return
	 */
	public List<BankAccountDetail> getBankAccountDetailListBySaleBranchNo(
			PCPSWebInput webInput) {
		return bankAccountDetailDao
				.getBankAccountDetailListBySaleBranchNo(webInput);
	}

	/**
	 * 获取银行账户入账流水总数
	 * 
	 * @param bankAccountId
	 *            银行账户ID
	 * @return
	 */
	public List<BankAccountDetail> getBankAccountDetailByAccID(
			PCPSWebInput webInput, BigInteger accountNoId, String status,
			Date startDate, Date endDate, String voucherNo,
			BigInteger startAmount, BigInteger endAmount,
			BigInteger createBranchNo, String isSingle, String paidType,
			String lenghtSection, Integer page)
			throws CapitalApplicationException {
		return bankAccountDetailBusinessImpl.getBankAccountDetailByAccID(
				webInput, accountNoId, status, startDate, endDate, voucherNo,
				startAmount, endAmount, createBranchNo, isSingle, paidType,
				lenghtSection, page);
	}

	/**
	 * 获取银行账户入账流水总金额
	 * 
	 * @param webInput
	 * @param accountNo
	 * @param bankAccSeqNo
	 * @param startDate
	 * @param endDate
	 * @param voucherNo
	 * @param startAmount
	 * @param endAmount
	 * @return
	 */
	public BigInteger getBankAccountDetailByTotalAmount(PCPSWebInput webInput,
			BigInteger accountNoId, String status, Date startDate,
			Date endDate, String voucherNo, BigInteger startAmount,
			BigInteger endAmount, BigInteger createBranchNo, String isSingle) {
		return bankAccountDetailDao.getBankAccountDetailByTotalAmount(webInput,
				accountNoId, status, startDate, endDate, voucherNo,
				startAmount, endAmount, createBranchNo, isSingle);
	}

	/**
	 * 销售单银行转账时选择的记录列表
	 * 
	 * @param webInput
	 * @param saleBranchNo
	 * @return
	 */
	public List<BankAccountDetail> getBankAccountDetailList(
			PCPSWebInput webInput, String saleBranchNo, int page) {
		return bankAccountDetailDao.getBankAccountDetailList(webInput,
				saleBranchNo, page);
	}

	/**
	 * 销售单银行转账时选择的记录数
	 * 
	 * @param webInput
	 * @param saleBranchNo
	 * @return
	 */
	public Integer getBankAccountDetailTotal(PCPSWebInput webInput,
			String saleBranchNo) {
		return bankAccountDetailDao.getBankAccountDetailTotal(webInput,
				saleBranchNo);
	}

	/**
	 * 添加一条银行账户入账流水明细
	 * 
	 * @param entity
	 */
	public CommonWebResult addBankAccountDetail(PCPSWebInput webInput,
			BankAccountDetail entity) throws PCPSApplicationException {

		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult result = new CommonWebResult();
		try {
			bankAccountDetailBusinessImpl
					.addBankAccountDetail(webInput, entity);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return result;
	}

	/**
	 * 根据ID删除一条银行账户入账流水明细
	 * 
	 * @param entity
	 */
	public CommonWebResult delBankAccountDetail(PCPSWebInput webInput,
			BankAccountDetail entity) throws PCPSApplicationException {

		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult result = new CommonWebResult();
		try {
			bankAccountDetailBusinessImpl
					.delBankAccountDetail(webInput, entity);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return result;
	}

	/**
	 * 修改一条银行账户入账流水明细
	 * 
	 * @param entity
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult modifyBankAccountDetail(PCPSWebInput webInput,
			BankAccountDetail entity) throws PCPSApplicationException {

		commonDaoImpl.setSysLogPath(webInput);
		CommonWebResult result = new CommonWebResult();
		try {
			bankAccountDetailBusinessImpl.modifyBankAccountDetail(webInput,
					entity);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return result;
	}

	@EJB(mappedName = "report.impl.CreditDaySettlementDaoImpl")
	private CreditDaySettlementDao cdsDao;

	/**
	 * 获取激活额度变动表数据,资金报表(西邮寄卡激活额度变动表)
	 * 
	 * @param issueCompanyNo
	 * @param tranDate
	 */
	public List<Object[]> getCreditDaySettlementReport(String issueCompanyNo,
			String tranDate, Integer page) {
		return cdsDao.getCreditDaySettlementReport(issueCompanyNo, tranDate,
				page);
	}

	/**
	 * 获取激活额度变动表数据总数,资金报表(西邮寄卡激活额度变动表)
	 * 
	 * @param issueCompanyNo
	 * @param tranDate
	 * @return
	 */
	public BigInteger getCreditDaySettlementTotalReport(String issueCompanyNo,
			String tranDate) {
		return cdsDao.getCreditDaySettlementTotalReport(issueCompanyNo,
				tranDate);
	}

	// start+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	// /**
	// * 重置发卡商卡密码
	// *
	// * @param key
	// * @param issueCompanyNo
	// * @return
	// */
	// public CommonWebResult updateActivateCardPwd(Integer key, Integer count,
	// String issueCompanyNo) {
	// try {
	// activateCardDaoImpl.updateActivateCardPwd(key, count,
	// issueCompanyNo);
	// } catch (PCPSApplicationException p) {
	// return PCPSException(p);
	// }
	// return new CommonWebResult();
	// }
	//
	// /**
	// * 测试插入制卡申请
	// *
	// * @param key
	// * @return
	// */
	// public Integer insertMakeCardControl(String key) {
	// return MakeCardControlDaoImpl.insertMakeCardControl(key);
	// }
	//
	// /**
	// * 测试激活MakeCardControl
	// *
	// * @param batchNo
	// * @param operid
	// * @throws PCPSApplicationException
	// */
	// public CommonWebResult activateMakeCardControl(String key, String
	// batchNo) {
	// try {
	// saleTransBusinessImpl.activateMakeCardControl(key, batchNo);
	// } catch (PCPSApplicationException p) {
	// return PCPSException(p);
	// }
	// return new CommonWebResult();
	// }
	//
	// // 模拟产生交易数据
	// @EJB(mappedName = "account.impl.AccountBusinessImpl")
	// private AccountBusiness accountBusinessImpl;
	//
	// public void genAccDetail(String issueCompanyNo, BigInteger subaccno,
	// String startDate, String endDate) {
	// PCPSUtil.setWebserviceLogEntry("test");
	// accountBusinessImpl.genAccDetail(issueCompanyNo, subaccno, startDate,
	// endDate);
	// }
	// end+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	/**
	 * 查询发卡商渠道收益机构列表
	 */
	public List<IncomeBranch> getAllIncomeBranchList(PCPSWebInput webInput) {

		commonDaoImpl.setSysLogPath(webInput);
		return incomeBranchDaoImpl.getAllIncomeBranchList(webInput);
	}

	/**
	 * 全省收入结算统计
	 * 
	 * @param incomeBranchID
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public List<Object[]> getIncomeDaySettlementStatistics(
			PCPSWebInput webInput, BigInteger incomeBranchID, String startDate,
			String endDate) {

		commonDaoImpl.setSysLogPath(webInput);
		return incomeDaySettlementDaoImpl.getIncomeDaySettlementStatistics(
				incomeBranchID, startDate, endDate);
	}

	/**
	 * 全省收入结算统计
	 * 
	 * @param incomeBranchID
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public List<Object[]> getIncomeSettlementStatistics(PCPSWebInput webInput,
			BigInteger incomeBranchID, String startDate, String endDate) {

		commonDaoImpl.setSysLogPath(webInput);
		return incomeDaySettlementDaoImpl.getIncomeSettlementStatistics(
				incomeBranchID, startDate, endDate);
	}

	// 额度明细
	@EJB(mappedName = "organization.impl.CreditAccDetailDaoImpl")
	private CreditAccDetailDao creditAccDetailDaoImpl;

	public List<CreditAccDetail> getCreditAccDetailList(PCPSWebInput input,
			String branchNo, String startDate, String endDate, String TranType,
			Integer page) {
		return creditAccDetailDaoImpl.getCreditAccDetailList(input, branchNo,
				startDate, endDate, TranType, page);
	}

	public Integer getCreditAccDetailTotal(PCPSWebInput input, String branchNo,
			String startDate, String endDate, String TranType) {
		return creditAccDetailDaoImpl.getCreditAccDetailTotal(input, branchNo,
				startDate, endDate, TranType);
	}

	@EJB(mappedName = "organization.impl.MerchantSecretPolicyBusinessImpl")
	private MerchantSecretPolicyBusiness merchantSecretPolicyBusinessImpl;
	@EJB(mappedName = "organization.impl.MerchantSecretPolicyDaoImpl")
	private MerchantSecretPolicyDao merchantSecretPolicyDaoImpl;

	/**
	 * 新增商户无密码交易策略
	 */
	public CommonWebResult insertMerchantSecretPolicy(PCPSWebInput input,
			MerchantSecretPolicy merchantSecretPolicy)
			throws PCPSApplicationException {
		commonDaoImpl.setSysLogPath(input);
		try {
			merchantSecretPolicyBusinessImpl.insertMerchantSecretPolicy(input,
					merchantSecretPolicy);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改商户无密码交易策略
	 */
	public CommonWebResult updateMerchantSecretPolicy(PCPSWebInput input,
			MerchantSecretPolicy merchantSecretPolicy)
			throws PCPSApplicationException {
		commonDaoImpl.setSysLogPath(input);
		try {
			merchantSecretPolicyBusinessImpl.updateMerchantSecretPolicy(input,
					merchantSecretPolicy);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return new CommonWebResult();
	}

	/**
	 * 根据主键查询
	 * 
	 * @param mspid
	 *            持卡人商户无密码策略ID
	 * @return
	 */
	public MerchantSecretPolicy getMerchantSecretPolicyByPolicyId(
			BigInteger mspid) {
		return merchantSecretPolicyDaoImpl
				.getMerchantSecretPolicyByPolicyId(mspid);
	}

	/**
	 * 根据业务查找满足条件的策略集合分页查询
	 * 
	 * @param msp
	 * @return
	 */
	public List<MerchantSecretPolicy> getMerchantSecretPolicyByBusinessPage(
			PCPSWebInput webInput, String MerchantNo, String CardFaceId,
			String CardClassicId, String Status, Integer page) {
		return merchantSecretPolicyDaoImpl
				.getMerchantSecretPolicyByBusinessPage(webInput, MerchantNo,
						CardFaceId, CardClassicId, Status, page);
	}

	/**
	 * 根据业务查找满足条件的策略集合数
	 * 
	 * @param msp
	 * @return
	 */
	public BigInteger getMerchantSecretPolicyByBusinessCount(
			PCPSWebInput webInput, String MerchantNo, String CardFaceId,
			String CardClassicId, String Status) {
		return merchantSecretPolicyDaoImpl
				.getMerchantSecretPolicyByBusinessCount(webInput, MerchantNo,
						CardFaceId, CardClassicId, Status);
	}

	/**
	 * 根据策略id删除策略
	 */
	public CommonWebResult deleteMerchantSecretPolicy(PCPSWebInput input,
			BigInteger feePolicyId) throws PCPSApplicationException {
		try {
			merchantSecretPolicyBusinessImpl.deleteMerchantSecretPolicy(input,
					feePolicyId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		}
		return new CommonWebResult();
	}

	/**
	 * 商户消费情况统计表
	 * 
	 * @param webInput
	 * @param startDate
	 * @param endDate
	 * @param todayDate
	 * @param merchantNoStr
	 * @return
	 */
	public List<Object[]> getMerchantDaySettlementCountReport(
			PCPSWebInput webInput, String startDate, String endDate,
			String todayDate, String merchantNoStr) {
		return merchantDaySettlementDaoImpl
				.getMerchantDaySettlementCountReport(webInput, startDate,
						endDate, todayDate, merchantNoStr);
	}

	/**
	 * 商户消费日报表
	 * 
	 * @param webInput
	 * @param tranDate
	 * @param merchantNoStr
	 * @return
	 */
	public List<Object[]> getMchTradDetailCountReport(PCPSWebInput webInput,
			String tranDate, String merchantNoStr) {
		return mchTradDetailDaoImpl.getMchTradDetailCountReport(webInput,
				tranDate, merchantNoStr);
	}

	@EJB(mappedName = "report.impl.MerchantBusinessDaySettlementDaoImpl")
	private MerchantBusinessDaySettlementDao merchantBusinessDaySettlementDao;

	/**
	 * 消费汇总表
	 * 
	 * @param issueCompanyNo
	 * @param startDate
	 * @param endDate
	 * @param merchantno
	 * @return
	 */
	public List<Object[]> getMerchantBusinessDaySettlementTotal(
			String issueCompanyNo, String startDate, String endDate,
			String merchantno) {
		return merchantBusinessDaySettlementDao
				.getMerchantBusinessDaySettlementTotal(issueCompanyNo,
						startDate, endDate, merchantno);
	}

	/**
	 * 驿站卡缴费汇总表
	 * 
	 * @param webInput
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	public List<Object[]> getMchAccDetailDakTotale(PCPSWebInput webInput,
			String startDate, String endDate, String merchantNo) {
		return mchAccDetailDaoImpl.getMchAccDetailDakTotale(webInput,
				startDate, endDate, merchantNo);
	}

	/**
	 * 数据迁移，通过新批次号检索对应老系统的卡面值
	 */
	@EJB(mappedName = "common.impl.ContrastDaoImpl")
	private ContrastDao contrastDaoImpl;

	public int getMapbatchnoValueByBranchno(String branchno) {
		return contrastDaoImpl.getMapbatchnoValueByBranchno(branchno);
	}

	/**
	 * 数据迁移，通过新批次号检索对应老系统的卡面值
	 */
	@EJB(mappedName = "organization.impl.MerchantSettDetailBusinessImpl")
	private MerchantSettDetailBusiness merchantSettDetailBusinessImpl;

	/**
	 * 添加商户结算明细
	 * 
	 * @param input
	 * @param entity
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult addMerchantSettDetail(PCPSWebInput input,
			MerchantSettDetail entity) {
		commonDaoImpl.setSysLogPath(input);
		try {
			merchantSettDetailBusinessImpl.addMerchantSettDetail(input, entity);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 修改商户结算明细
	 * 
	 * @param input
	 * @param entity
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult modifyMerchantSettDetail(PCPSWebInput input,
			MerchantSettDetail entity) {
		commonDaoImpl.setSysLogPath(input);
		try {
			merchantSettDetailBusinessImpl.modifyMerchantSettDetail(input,
					entity);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 删除商户结算明细
	 * 
	 * @param input
	 * @param mrchSettDetailId
	 * @throws PCPSApplicationException
	 */
	public CommonWebResult delMerchantSettDetail(PCPSWebInput input,
			BigInteger mrchSettDetailId) {
		commonDaoImpl.setSysLogPath(input);
		try {
			merchantSettDetailBusinessImpl.delMerchantSettDetail(input,
					mrchSettDetailId);
		} catch (PCPSApplicationException p) {
			return PCPSException(p);
		} catch (Exception e) {
			return CommonException(e);
		}
		return new CommonWebResult();
	}

	/**
	 * 分页查询列表
	 * 
	 * @param input
	 * @param merchantNo
	 * @param tranDate
	 * @param voucherNo
	 * @param page
	 * @return
	 * @throws PCPSApplicationException
	 */
	public List<MerchantSettDetail> getMerchantSettDetailList(
			PCPSWebInput input, String merchantNo, String starDate,
			String endDate, String voucherNo, Integer page) {
		return merchantSettDetailBusinessImpl.getMerchantSettDetailList(input,
				merchantNo, starDate, endDate, voucherNo, page);
	}

	/**
	 * 查询数据数量
	 * 
	 * @param input
	 * @param merchantNo
	 * @param tranDate
	 * @param voucherNo
	 * @return
	 * @throws PCPSApplicationException
	 */
	public BigInteger getMerchantSettDetailTotal(PCPSWebInput input,
			String merchantNo, String starDate, String endDate, String voucherNo) {
		return merchantSettDetailBusinessImpl.getMerchantSettDetailTotal(input,
				merchantNo, starDate, endDate, voucherNo);
	}

	/**
	 * 根据id查询商户结算明细
	 * 
	 * @param input
	 * @param mrchSettDetailId
	 * @return
	 * @throws PCPSApplicationException
	 */
	public MerchantSettDetail getMerchantSettDetailByID(PCPSWebInput input,
			BigInteger mrchSettDetailId) {
		return merchantSettDetailBusinessImpl.getMerchantSettDetailByID(input,
				mrchSettDetailId);
	}
}